+
+ def remove(self, db_conn: DatabaseConnection) -> None:
+ """Remove from DB, including relations."""
+ assert isinstance(self.id_, int)
+ children_to_remove = self.children[:]
+ parents_to_remove = self.parents[:]
+ for child in children_to_remove:
+ self.remove_child(child)
+ for parent in parents_to_remove:
+ parent.remove_child(self)
+ db_conn.delete_where('todo_children', 'parent', self.id_)
+ db_conn.delete_where('todo_children', 'child', self.id_)
+ db_conn.delete_where('todo_conditions', 'todo', self.id_)
+ db_conn.delete_where('todo_enables', 'todo', self.id_)
+ db_conn.delete_where('todo_disables', 'todo', self.id_)
+ super().remove(db_conn)