X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=e541057ed793ebe2a53c55b50a11be7133c5884f;hb=54e6c8bccace28583cf9926aa00917a796628a00;hp=4bf58b41a2cb264a0a40bf018ee9c5536e358bda;hpb=c2004503dc42449f1fa129b8e56eeef0a6df4712;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 4bf58b4..e541057 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -120,6 +120,11 @@ class TaskHandler(BaseHTTPRequestHandler): """Show single Day of ?date=.""" date = self.params.get_str('date', todays_date()) conditions_listing = [] + top_todos = [t for t in Todo.by_date(self.conn, date) if not t.parents] + seen_todos: set[int] = set() + seen_conditions: set[int] = set() + todo_trees = [t.get_step_tree(seen_todos, seen_conditions) + for t in top_todos] for condition in Condition.all(self.conn): enablers = Todo.enablers_for_at(self.conn, condition, date) disablers = Todo.disablers_for_at(self.conn, condition, date) @@ -128,7 +133,7 @@ class TaskHandler(BaseHTTPRequestHandler): 'enablers': enablers, 'disablers': disablers}] return {'day': Day.by_id(self.conn, date, create=True), - 'todos': Todo.by_date(self.conn, date), + 'todo_trees': todo_trees, 'processes': Process.all(self.conn), 'conditions_listing': conditions_listing}