home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix pre-commit script failing to delete test DBs based on new filename format.
[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: