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: