home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enhance BaseModel comparisons by hashing versioned and relations attributes.
[plomtask]
/
plomtask
/
http.py
diff --git
a/plomtask/http.py
b/plomtask/http.py
index 3d507be9b344ff8be7ca26952bfa422872ec6b78..230ed3f26c5d53398a27d87558a28abeb28ceff5 100644
(file)
--- a/
plomtask/http.py
+++ b/
plomtask/http.py
@@
-191,8
+191,6
@@
class TaskHandler(BaseHTTPRequestHandler):
ret = Day.by_date_range_with_limits(self.conn, (start, end), 'id')
days, start, end = ret
days = Day.with_filled_gaps(days, start, end)
ret = Day.by_date_range_with_limits(self.conn, (start, end), 'id')
days, start, end = ret
days = Day.with_filled_gaps(days, start, end)
- for day in days:
- day.collect_calendarized_todos(self.conn)
today = date_in_n_days(0)
return {'start': start, 'end': end, 'days': days, 'today': today}
today = date_in_n_days(0)
return {'start': start, 'end': end, 'days': days, 'today': today}
@@
-207,15
+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)
- total_effort = 0.0
- for todo in todays_todos:
- total_effort += todo.performed_effort
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]
@@
-227,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': total_effort,
+ 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,