home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Re-factor Day.todos code.
[plomtask]
/
plomtask
/
http.py
diff --git
a/plomtask/http.py
b/plomtask/http.py
index 91db32601c24c91c49db75df4f9ca2b05fd9b944..230ed3f26c5d53398a27d87558a28abeb28ceff5 100644
(file)
--- a/
plomtask/http.py
+++ b/
plomtask/http.py
@@
-205,12
+205,13
@@
class TaskHandler(BaseHTTPRequestHandler):
def do_GET_day(self) -> dict[str, object]:
"""Show single Day of ?date=."""
date = self._params.get_str('date', date_in_n_days(0))
def do_GET_day(self) -> dict[str, object]:
"""Show single Day of ?date=."""
date = self._params.get_str('date', date_in_n_days(0))
+ day = Day.by_id(self.conn, date, create=True,
+ init_empty_todo_list=True)
make_type = self._params.get_str('make_type')
make_type = self._params.get_str('make_type')
- todays_todos = Todo.by_date(self.conn, date)
conditions_present = []
enablers_for = {}
disablers_for = {}
conditions_present = []
enablers_for = {}
disablers_for = {}
- for todo in
todays_
todos:
+ for todo in
day.
todos:
for condition in todo.conditions + todo.blockers:
if condition not in conditions_present:
conditions_present += [condition]
for condition in todo.conditions + todo.blockers:
if condition not in conditions_present:
conditions_present += [condition]
@@
-222,9
+223,8
@@
class TaskHandler(BaseHTTPRequestHandler):
if condition in p.disables]
seen_todos: set[int] = set()
top_nodes = [t.get_step_tree(seen_todos)
if condition in p.disables]
seen_todos: set[int] = set()
top_nodes = [t.get_step_tree(seen_todos)
- for t in todays_todos if not t.parents]
- return {'day': Day.by_id(self.conn, date, create=True),
- 'total_effort': Todo.total_effort_at_date(self.conn, date),
+ for t in day.todos if not t.parents]
+ return {'day': day,
'top_nodes': top_nodes,
'make_type': make_type,
'enablers_for': enablers_for,
'top_nodes': top_nodes,
'make_type': make_type,
'enablers_for': enablers_for,