- def save(self, db_conn: DatabaseConnection) -> None:
- """Write self and children to DB and its cache."""
- if self.process.id_ is None:
- raise NotFoundException('Process of Todo without ID (not saved?)')
- self.save_core(db_conn)
- assert isinstance(self.id_, int)
- db_conn.rewrite_relations('todo_children', 'child', self.id_,
- [[p.id_] for p in self.parents])
- db_conn.rewrite_relations('todo_children', 'parent', self.id_,
- [[c.id_] for c in self.children])
- db_conn.rewrite_relations('todo_conditions', 'todo', self.id_,
- [[c.id_] for c in self.conditions])
- db_conn.rewrite_relations('todo_enables', 'todo', self.id_,
- [[c.id_] for c in self.enables])
- db_conn.rewrite_relations('todo_disables', 'todo', self.id_,
- [[c.id_] for c in self.disables])
-