home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fuse Day.by_id_or_create and Day.by_id, as valid_date call in the first one fits...
[plomtask]
/
plomtask
/
processes.py
diff --git
a/plomtask/processes.py
b/plomtask/processes.py
index 06ee4ba9b9c2a3011019b03b1b0e21633fce780c..36158996595dccfad678730eb29a50c422c26b9d 100644
(file)
--- a/
plomtask/processes.py
+++ b/
plomtask/processes.py
@@
-33,7
+33,9
@@
class Process(BaseModel[int], ConditionsRelations):
('process_disables', 'process', 'disables', 0),
('process_step_suppressions', 'process',
'suppressed_steps', 0)]
('process_disables', 'process', 'disables', 0),
('process_step_suppressions', 'process',
'suppressed_steps', 0)]
+ add_to_dict = ['explicit_steps']
to_search = ['title.newest', 'description.newest']
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_)
@@
-51,11
+53,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)
@@
-218,7
+216,7
@@
class ProcessStep(BaseModel[int]):
self.parent_step_id = parent_step_id
def save(self, db_conn: DatabaseConnection) -> None:
self.parent_step_id = parent_step_id
def save(self, db_conn: DatabaseConnection) -> None:
- """
Remove from DB
, and owner's .explicit_steps."""
+ """
Update into DB/cache
, and owner's .explicit_steps."""
super().save(db_conn)
owner = Process.by_id(db_conn, self.owner_id)
if self not in owner.explicit_steps:
super().save(db_conn)
owner = Process.by_id(db_conn, self.owner_id)
if self not in owner.explicit_steps: