- @staticmethod
- def _x_ablers_for_at(db_conn: DatabaseConnection, name: str,
- cond: Condition, date: str) -> list[Todo]:
- """Collect all Todos of day that [name] condition."""
- assert isinstance(cond.id_, int)
- x_ablers = []
- table = f'todo_{name}'
- for id_ in db_conn.column_where(table, 'todo', 'condition', cond.id_):
- todo = Todo.by_id(db_conn, id_)
- if todo.date == date:
- x_ablers += [todo]
- return x_ablers
-
- @classmethod
- def enablers_for_at(cls, db_conn: DatabaseConnection,
- condition: Condition, date: str) -> list[Todo]:
- """Collect all Todos of day that enable condition."""
- return cls._x_ablers_for_at(db_conn, 'enables', condition, date)
-
- @classmethod
- def disablers_for_at(cls, db_conn: DatabaseConnection,
- condition: Condition, date: str) -> list[Todo]:
- """Collect all Todos of day that disable condition."""
- return cls._x_ablers_for_at(db_conn, 'disables', condition, date)
-