- def collect_calendarized_todos(self, db_conn: DatabaseConnection) -> None:
- """Fill self.calendarized_todos."""
- self.calendarized_todos = [t for t in Todo.by_date(db_conn, self.date)
- if t.calendarize]
+ @property
+ def calendarized_todos(self) -> list[Todo]:
+ """Return only those of self.todos that have .calendarize set."""
+ if self.todos is None:
+ msg = 'Trying to return from un-initialized Day.todos.'
+ raise HandledException(msg)
+ # pylint: disable=not-an-iterable
+ # (after the above is-None test, self.todos _should_ be iterable!)
+ return [t for t in self.todos if t.calendarize]