home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Default all GET ?sort_by= to "title" also in params-re-writing.
[plomtask]
/
plomtask
/
days.py
diff --git
a/plomtask/days.py
b/plomtask/days.py
index afe4a01be6f509a8b624da7c45650500a96805e2..a924bbfeadd2bd895d2f21ac4b7487305fbe771f 100644
(file)
--- a/
plomtask/days.py
+++ b/
plomtask/days.py
@@
-23,6
+23,13
@@
class Day(BaseModel[str]):
def __lt__(self, other: Day) -> bool:
return self.date < other.date
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:
@classmethod
def from_table_row(cls, db_conn: DatabaseConnection, row: Row | list[Any]
) -> Day: