- def __lt__(self, other):
- return self.date < other.date
+ @property
+ def next_date(self) -> str:
+ """Return date succeeding date of this Day."""
+ next_datetime = self.datetime + timedelta(days=1)
+ return next_datetime.strftime(DATE_FORMAT)
+
+ @property
+ def todos(self) -> list[Todo]:
+ """Return self.todos if initialized, else raise Exception."""
+ if self._todos is None:
+ msg = 'Trying to return from un-initialized Day.todos.'
+ raise HandledException(msg)
+ return list(self._todos)
+
+ @property
+ def calendarized_todos(self) -> list[Todo]:
+ """Return only those of self.todos that have .calendarize set."""
+ return [t for t in self.todos if t.calendarize]
+
+ @property
+ def total_effort(self) -> float:
+ """"Sum all .performed_effort of self.todos."""
+ total_effort = 0.0
+ for todo in self.todos:
+ total_effort += todo.performed_effort
+ return total_effort