X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=2c7e628bdd14fd572a29c5686a5d3a5a37ceb409;hb=29969c2d0fb6c464662737df1da94f76dc2c0982;hp=2ecfcaa3734325951bad368d91e7aaeaafb836fe;hpb=e60bbd142b5026748ee2181ca6758afef6202fb4;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 2ecfcaa..2c7e628 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -94,8 +94,9 @@ class TaskHandler(BaseHTTPRequestHandler): """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) @@ -156,7 +157,7 @@ class TaskHandler(BaseHTTPRequestHandler): 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, @@ -165,6 +166,24 @@ class TaskHandler(BaseHTTPRequestHandler): '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)} @@ -248,7 +267,7 @@ class TaskHandler(BaseHTTPRequestHandler): todo.set_enables(self.conn, self.form_data.get_all_int('enables')) todo.set_disables(self.conn, self.form_data.get_all_int('disables')) todo.is_done = len(self.form_data.get_all_str('done')) > 0 - todo.comment = self.form_data.get_str('comment') + todo.comment = self.form_data.get_str('comment', ignore_strict=True) todo.save(self.conn) for condition in todo.enables: condition.save(self.conn)