home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor remaining test.utils helpers into actual tests.
[plomtask]
/
plomtask
/
processes.py
diff --git
a/plomtask/processes.py
b/plomtask/processes.py
index 6df8eaf9132d7652e447931d59a2cc6a39d3043b..d007d0f0ff14303e7668146323f0b2384a35cf55 100644
(file)
--- a/
plomtask/processes.py
+++ b/
plomtask/processes.py
@@
-34,6
+34,7
@@
class Process(BaseModel[int], ConditionsRelations):
('process_step_suppressions', 'process',
'suppressed_steps', 0)]
to_search = ['title.newest', 'description.newest']
('process_step_suppressions', 'process',
'suppressed_steps', 0)]
to_search = ['title.newest', 'description.newest']
+ can_create_by_id = True
def __init__(self, id_: int | None, calendarize: bool = False) -> None:
BaseModel.__init__(self, id_)
def __init__(self, id_: int | None, calendarize: bool = False) -> None:
BaseModel.__init__(self, id_)
@@
-59,11
+60,7
@@
class Process(BaseModel[int], ConditionsRelations):
row: Row | list[Any]) -> Process:
"""Make from DB row, with dependencies."""
process = super().from_table_row(db_conn, row)
row: Row | list[Any]) -> Process:
"""Make from DB row, with dependencies."""
process = super().from_table_row(db_conn, row)
- assert isinstance(process.id_, int)
- for name in ('title', 'description', 'effort'):
- table = f'process_{name}s'
- for row_ in db_conn.row_where(table, 'parent', process.id_):
- getattr(process, name).history_from_row(row_)
+ assert process.id_ is not None
for name in ('conditions', 'blockers', 'enables', 'disables'):
table = f'process_{name}'
assert isinstance(process.id_, int)
for name in ('conditions', 'blockers', 'enables', 'disables'):
table = f'process_{name}'
assert isinstance(process.id_, int)