home · contact · privacy
Refactor save and remove methods of BaseObject subclasses.
[plomtask] / plomtask / versioned_attributes.py
index ab39df098059e416c7627b5fcefecae2668d7c06..1810a318d3781c96626f40d679c53db42072403d 100644 (file)
@@ -66,3 +66,7 @@ class VersionedAttribute:
         db_conn.rewrite_relations(self.table_name, 'parent', self.parent.id_,
                                   [[item[0], item[1]]
                                    for item in self.history.items()])
+
+    def remove(self, db_conn: DatabaseConnection) -> None:
+        """Remove from DB."""
+        db_conn.delete_where(self.table_name, 'parent', self.parent.id_)