"""Handle any GET request."""
try:
self._init_handling()
- if self.site in {'calendar', 'day', 'process', 'processes', 'todo',
- 'condition', 'conditions'}:
+ if self.site in {'calendar', 'day', 'process', 'process_titles',
+ 'process_descriptions', 'process_efforts',
+ 'processes', 'todo', 'condition', 'conditions'}:
template = f'{self.site}.html'
ctx = getattr(self, f'do_GET_{self.site}')()
html = self.server.jinja.get_template(template).render(**ctx)
return {'condition': Condition.by_id(self.conn, id_, create=True)}
def do_GET_process(self) -> dict[str, object]:
- """Show process of ?id=."""
+ """Show Process of ?id=."""
id_ = self.params.get_int_or_none('id')
process = Process.by_id(self.conn, id_, create=True)
return {'process': process,
'step_candidates': Process.all(self.conn),
'condition_candidates': Condition.all(self.conn)}
+ def do_GET_process_titles(self) -> dict[str, object]:
+ """Show title history of Process of ?id=."""
+ id_ = self.params.get_int_or_none('id')
+ process = Process.by_id(self.conn, id_)
+ return {'process': process}
+
+ def do_GET_process_descriptions(self) -> dict[str, object]:
+ """Show description historys of Process of ?id=."""
+ id_ = self.params.get_int_or_none('id')
+ process = Process.by_id(self.conn, id_)
+ return {'process': process}
+
+ def do_GET_process_efforts(self) -> dict[str, object]:
+ """Show default effort history of Process of ?id=."""
+ id_ = self.params.get_int_or_none('id')
+ process = Process.by_id(self.conn, id_)
+ return {'process': process}
+
def do_GET_processes(self) -> dict[str, object]:
"""Show all Processes."""
return {'processes': Process.all(self.conn)}