X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomtask%2Fhttp.py;fp=plomtask%2Fhttp.py;h=88725fcc57b9ada06d2bb85a4744b489a8bf97e7;hb=53f151ef577dd8115e72d38a8991ad77c75f7e59;hp=2c7e628bdd14fd572a29c5686a5d3a5a37ceb409;hpb=9d71377b8a808bbe96f15768fe79ee02c61f15bc;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 2c7e628..88725fc 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -96,7 +96,9 @@ class TaskHandler(BaseHTTPRequestHandler): self._init_handling() if self.site in {'calendar', 'day', 'process', 'process_titles', 'process_descriptions', 'process_efforts', - 'processes', 'todo', 'condition', 'conditions'}: + 'processes', 'todo', 'condition', + 'condition_titles', 'condition_descriptions', + 'conditions'}: template = f'{self.site}.html' ctx = getattr(self, f'do_GET_{self.site}')() html = self.server.jinja.get_template(template).render(**ctx) @@ -156,6 +158,18 @@ class TaskHandler(BaseHTTPRequestHandler): id_ = self.params.get_int_or_none('id') return {'condition': Condition.by_id(self.conn, id_, create=True)} + def do_GET_condition_titles(self) -> dict[str, object]: + """Show title history of Condition of ?id=.""" + id_ = self.params.get_int_or_none('id') + condition = Condition.by_id(self.conn, id_) + return {'condition': condition} + + def do_GET_condition_descriptions(self) -> dict[str, object]: + """Show description historys of Condition of ?id=.""" + id_ = self.params.get_int_or_none('id') + condition = Condition.by_id(self.conn, id_) + return {'condition': condition} + def do_GET_process(self) -> dict[str, object]: """Show Process of ?id=.""" id_ = self.params.get_int_or_none('id')