"""Non-Process dependency for ProcessSteps and Todos."""
table_name = 'conditions'
to_save = ['is_active']
+ to_save_versioned = ['title', 'description']
def __init__(self, id_: int | None, is_active: bool = False) -> None:
super().__init__(id_)
getattr(condition, name).history_from_row(row_)
return condition
- def save(self, db_conn: DatabaseConnection) -> None:
- """Save self and its VersionedAttributes to DB and cache."""
- self.save_core(db_conn)
- self.title.save(db_conn)
- self.description.save(db_conn)
-
def remove(self, db_conn: DatabaseConnection) -> None:
"""Remove from DB, with VersionedAttributes.
table_name = f'{item}_{attr}'
for _ in db_conn.row_where(table_name, 'condition', self.id_):
raise HandledException('cannot remove Condition in use')
- db_conn.delete_where('condition_titles', 'parent', self.id_)
- db_conn.delete_where('condition_descriptions', 'parent', self.id_)
super().remove(db_conn)