day = Day.by_id(self.conn, date, create=True)
day.comment = self.form_data.get_str('day_comment')
day.save(self.conn)
- new_todos = []
- for process_id in self.form_data.get_all_int('new_todo'):
- process = Process.by_id(self.conn, process_id)
- todo = Todo(None, process, False, day.date)
- todo.save(self.conn)
- new_todos += [todo]
- adopted = True
- while adopted:
- adopted = False
- existing_todos = Todo.by_date(self.conn, date)
- for todo in new_todos:
- if todo.adopt_from(existing_todos):
- adopted = True
- todo.make_missing_children(self.conn)
- todo.save(self.conn)
+ Todo.create_with_children(self.conn, date,
+ self.form_data.get_all_int('new_todo'))
done_ids = self.form_data.get_all_int('done')
comments = self.form_data.get_all_str('comment')
efforts = self.form_data.get_all_str('effort')