home · contact · privacy
Allow creation of new Todos rather than just adoption from Todo edit view.
[plomtask] / plomtask / http.py
index 773548f8a9201e3e48ab8093b6431ab826842110..1a06f3094c9c66a95f73b9a13e52d7618d3b2aaa 100644 (file)
@@ -156,6 +156,7 @@ class TaskHandler(BaseHTTPRequestHandler):
         id_ = self.params.get_int('id')
         todo = Todo.by_id(self.conn, id_)
         return {'todo': todo,
+                'process_candidates': Process.all(self.conn),
                 'todo_candidates': Todo.by_date(self.conn, todo.date),
                 'condition_candidates': Condition.all(self.conn)}
 
@@ -359,6 +360,9 @@ class TaskHandler(BaseHTTPRequestHandler):
                 continue
             child = Todo.by_id(self.conn, child_id)
             todo.add_child(child)
+        for process_id in self.form_data.get_all_int('make'):
+            made = Todo.create_with_children(self.conn, process_id, todo.date)
+            todo.add_child(made)
         effort = self.form_data.get_str('effort', ignore_strict=True)
         todo.effort = float(effort) if effort else None
         todo.set_conditions(self.conn, self.form_data.get_all_int('condition'))