def do_GET_conditions(self) -> dict[str, object]:
"""Show all Conditions."""
- conditions = Condition.all(self.conn)
+ pattern = self.params.get_str('pattern')
+ conditions = Condition.matching(self.conn, pattern)
sort_by = self.params.get_str('sort_by')
if sort_by == 'is_active':
conditions.sort(key=lambda c: c.is_active)
conditions.sort(key=lambda c: c.title.newest, reverse=True)
else:
conditions.sort(key=lambda c: c.title.newest)
- return {'conditions': conditions, 'sort_by': sort_by}
+ return {'conditions': conditions,
+ 'sort_by': sort_by,
+ 'pattern': pattern}
def do_GET_condition(self) -> dict[str, object]:
"""Show Condition of ?id=."""
def do_GET_processes(self) -> dict[str, object]:
"""Show all Processes."""
- processes = Process.all(self.conn)
+ pattern = self.params.get_str('pattern')
+ processes = Process.matching(self.conn, pattern)
sort_by = self.params.get_str('sort_by')
if sort_by == 'steps':
processes.sort(key=lambda c: len(c.explicit_steps))
processes.sort(key=lambda c: c.title.newest, reverse=True)
else:
processes.sort(key=lambda c: c.title.newest)
- return {'processes': processes, 'sort_by': sort_by}
+ return {'processes': processes, 'sort_by': sort_by, 'pattern': pattern}
def do_POST(self) -> None:
"""Handle any POST request."""