Refactor database message handling to support multiple messages and enhance type hints across various classes
This commit is contained in:
@@ -3,7 +3,7 @@ from PyQt6 import QtWidgets
|
||||
from .dialog_sources.reminder_ui import Ui_Erinnerung as Ui_Dialog
|
||||
from src import Icon
|
||||
import datetime as date
|
||||
|
||||
from typing import Any
|
||||
|
||||
class ReminderDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
@@ -13,8 +13,10 @@ class ReminderDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.setWindowTitle("Erinnerung")
|
||||
self.dateEdit.setDate(date.datetime.now())
|
||||
|
||||
def return_message(self) -> dict:
|
||||
return {
|
||||
"message": self.message_box.toPlainText(),
|
||||
"remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
|
||||
}
|
||||
def return_message(self) -> list[dict[str, Any]]:
|
||||
return [
|
||||
{
|
||||
"message": self.message_box.toPlainText(),
|
||||
"remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user