X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plomtask%2Fdays.py;fp=plomtask%2Fdays.py;h=92e44b2330b27caf7da9a3fce9ffca8aff3e7bc5;hb=5a393ec6a77d8f1040763ffa3e9e908f38a0e517;hp=68cf989643924a42b1ef8b48cc04a63434efe6b9;hpb=1701d662f8163d5dc93bf87988e740639108f6ad;p=plomtask diff --git a/plomtask/days.py b/plomtask/days.py index 68cf989..92e44b2 100644 --- a/plomtask/days.py +++ b/plomtask/days.py @@ -12,6 +12,7 @@ class Day(BaseModel[str]): """Individual days defined by their dates.""" table_name = 'days' to_save = ['comment'] + add_to_dict = ['todos'] can_create_by_id = True def __init__(self, date: str, comment: str = '') -> None: @@ -24,15 +25,6 @@ class Day(BaseModel[str]): def __lt__(self, other: Day) -> bool: return self.date < other.date - @property - def as_dict(self) -> dict[str, object]: - """Return self as (json.dumps-coompatible) dict.""" - d = super().as_dict - assert isinstance(d['_library'], dict) - d['todos'] = [t.as_dict_into_reference(d['_library']) - for t in self.todos] - return d - @classmethod def from_table_row(cls, db_conn: DatabaseConnection, row: Row | list[Any] ) -> Day: