"""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:
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
- d['todos'] = [t.as_dict for t in self.todos]
- return d
-
@classmethod
def from_table_row(cls, db_conn: DatabaseConnection, row: Row | list[Any]
) -> Day: