+ process_id = form_data.get_int_or_none('new_todo')
+ if process_id is not None:
+ process = Process.by_id(conn, process_id)
+ todo = Todo(None, process, False, day)
+ todo.save(conn)
+
+ def do_POST_todo(self, conn: DatabaseConnection, params: ParamsParser,
+ form_data: PostvarsParser) -> None:
+ """Update Todo and its children."""
+ id_ = params.get_int_or_none('id')
+ todo = Todo.by_id(conn, id_)
+ child_id = form_data.get_int_or_none('adopt')
+ if child_id is not None:
+ child = Todo.by_id(conn, child_id)
+ todo.add_child(child)
+ todo.save(conn)