- return {'day': Day.by_date(self.conn, date, create=True),
+ return {'day': Day.by_id(self.conn, date, create=True),
'todos': Todo.by_date(self.conn, date),
'processes': Process.all(self.conn),
'conditions_listing': conditions_listing}
def do_GET_todo(self) -> dict[str, object]:
"""Show single Todo of ?id=."""
'todos': Todo.by_date(self.conn, date),
'processes': Process.all(self.conn),
'conditions_listing': conditions_listing}
def do_GET_todo(self) -> dict[str, object]:
"""Show single Todo of ?id=."""
'condition_candidates': Condition.all(self.conn)}
def do_GET_conditions(self) -> dict[str, object]:
'condition_candidates': Condition.all(self.conn)}
def do_GET_conditions(self) -> dict[str, object]:
def do_POST_day(self) -> None:
"""Update or insert Day of date and Todos mapped to it."""
date = self.params.get_str('date')
def do_POST_day(self) -> None:
"""Update or insert Day of date and Todos mapped to it."""
date = self.params.get_str('date')
day.comment = self.form_data.get_str('comment')
day.save(self.conn)
process_id = self.form_data.get_int_or_none('new_todo')
if process_id is not None:
process = Process.by_id(self.conn, process_id)
day.comment = self.form_data.get_str('comment')
day.save(self.conn)
process_id = self.form_data.get_int_or_none('new_todo')
if process_id is not None:
process = Process.by_id(self.conn, process_id)
- todo = Todo(None, process, False, day)
+ todo = Todo(None, process, False, day.date)
todo = Todo.by_id(self.conn, id_)
child_id = self.form_data.get_int_or_none('adopt')
if child_id is not None:
todo = Todo.by_id(self.conn, id_)
child_id = self.form_data.get_int_or_none('adopt')
if child_id is not None:
self.form_data.get_all_int('condition'))
process.set_fulfills(self.conn, self.form_data.get_all_int('fulfills'))
process.set_undoes(self.conn, self.form_data.get_all_int('undoes'))
self.form_data.get_all_int('condition'))
process.set_fulfills(self.conn, self.form_data.get_all_int('fulfills'))
process.set_undoes(self.conn, self.form_data.get_all_int('undoes'))
- for step_process_id in\
- self.form_data.get_all_int(f'new_step_to_{step_id}'):
- process.add_step(self.conn, None, step_process_id, step_id)
+ for step_process_id in self.form_data.get_all_int(
+ f'new_step_to_{step_id}'):
+ steps += [(None, step_process_id, step_id)]
if step_id not in self.form_data.get_all_int('keep_step'):
continue
step_process_id = self.form_data.get_int(
f'step_{step_id}_process_id')
parent_id = self.form_data.get_int_or_none(
f'step_{step_id}_parent_id')
if step_id not in self.form_data.get_all_int('keep_step'):
continue
step_process_id = self.form_data.get_int(
f'step_{step_id}_process_id')
parent_id = self.form_data.get_int_or_none(
f'step_{step_id}_parent_id')
- process.add_step(self.conn, step_id, step_process_id, parent_id)
+ steps += [(step_id, step_process_id, parent_id)]
- process.add_step(self.conn, None, step_process_id, None)
- process.fix_steps(self.conn)
+ steps += [(None, step_process_id, None)]
+ process.set_steps(self.conn, steps)
+ process.save(self.conn)
def do_POST_condition(self) -> None:
"""Update/insert Condition of ?id= and fields defined in postvars."""
def do_POST_condition(self) -> None:
"""Update/insert Condition of ?id= and fields defined in postvars."""