('todo_disables', 'todo', 'disables'),
('todo_children', 'parent', 'children'),
('todo_children', 'child', 'parents')]
+ to_search = ['comment']
# pylint: disable=too-many-arguments
def __init__(self, id_: int | None,
target += [Condition.by_id(db_conn, cond_id)]
return todo
+ @classmethod
+ def by_process_id(cls, db_conn: DatabaseConnection,
+ process_id: int | None) -> list[Todo]:
+ """Collect all Todos of Process of process_id."""
+ return [t for t in cls.all(db_conn) if t.process.id_ == process_id]
+
@classmethod
def by_date(cls, db_conn: DatabaseConnection, date: str) -> list[Todo]:
"""Collect all Todos for Day of date."""
"""Shortcut to .process.title."""
return self.process.title
+ @property
+ def title_then(self) -> str:
+ """Shortcut to .process.title.at(self.date)"""
+ title_then = self.process.title.at(self.date)
+ assert isinstance(title_then, str)
+ return title_then
+
+ @property
+ def effort_then(self) -> float:
+ """Shortcut to .process.effort.at(self.date)"""
+ effort_then = self.process.effort.at(self.date)
+ assert isinstance(effort_then, float)
+ return effort_then
+
def adopt_from(self, todos: list[Todo]) -> bool:
"""As far as possible, fill unsatisfied dependencies from todos."""
adopted = False