def do_GET_conditions(self) -> dict[str, object]:
"""Show all Conditions."""
pattern = self._params.get_str('pattern')
- conditions = Condition.matching(self.conn, pattern)
sort_by = self._params.get_str('sort_by')
+ conditions = Condition.matching(self.conn, pattern)
if sort_by == 'is_active':
conditions.sort(key=lambda c: c.is_active)
elif sort_by == '-is_active':
@_get_item(Process)
def do_GET_process(self, process: Process) -> dict[str, object]:
"""Show Process of ?id=."""
+ owner_ids = self._params.get_all_int('step_to')
+ owned_ids = self._params.get_all_int('has_step')
title_64 = self._params.get_str('title_b64')
if title_64:
title = b64decode(title_64.encode()).decode()
process.title.set(title)
owners = process.used_as_step_by(self.conn)
- for step_id in self._params.get_all_int('step_to'):
+ for step_id in owner_ids:
owners += [Process.by_id(self.conn, step_id)]
preset_top_step = None
- for process_id in self._params.get_all_int('has_step'):
+ for process_id in owned_ids:
preset_top_step = process_id
return {'process': process, 'is_new': process.id_ is None,
'preset_top_step': preset_top_step,
def do_GET_processes(self) -> dict[str, object]:
"""Show all Processes."""
pattern = self._params.get_str('pattern')
- processes = Process.matching(self.conn, pattern)
sort_by = self._params.get_str('sort_by')
+ processes = Process.matching(self.conn, pattern)
if sort_by == 'steps':
processes.sort(key=lambda p: len(p.explicit_steps))
elif sort_by == '-steps':