+ self.selected_day_date = str(datetime.now())[:10]
+ self.selected_day = self.add_day()
+
+ def add_task(self, id_=None, dict_source=None, return_id=False):
+ t = Task.from_dict(self, dict_source) if dict_source else Task(self)
+ id_ = id_ if id_ else str(uuid4())
+ self.tasks[id_] = t
+ if return_id:
+ return id_, t
+ else:
+ return t
+
+ def add_day(self, dict_source=None):
+ return Day.from_dict(self, dict_source) if dict_source else Day(self)
+
+ def show_all(self):
+ for i in range(10):
+ self.add_task(id_=f'new{i}')
+ for date, day in self.old_days.items():
+ for task_uuid, todo in day.todos.items():
+ todo.title = self.tasks[task_uuid].title_at(date)
+ return Template(selected_day_tmpl + old_days_tmpl + form_footer).render(db=self, action=self.prefix+'/all')
+
+ def show_selected_day(self):
+ return Template(selected_day_tmpl + form_footer).render(db=self, action=self.prefix+'/day')