assert primary key exists in record before attempting to delete it
[plcapi.git] / PLC / NodeTags.py
index 22c7728..e911244 100644 (file)
@@ -3,7 +3,7 @@
 #
 from PLC.Faults import *
 from PLC.Parameter import Parameter
-from PLC.Storage.AlchemyObj import AlchemyObj
+from PLC.Storage.AlchemyObject import AlchemyObj
 from PLC.Nodes import Node, Nodes
 from PLC.TagTypes import TagType, TagTypes
 
@@ -33,6 +33,7 @@ class NodeTag(AlchemyObj):
             AlchemyObj.update(self, {'node_tag_id': self['node_tag_id']}, dict(self))
 
     def delete(self, commit=True):
+        assert 'node_tag_id' in self
         AlchemyObj.delete(self, dict(self))        
 
 class NodeTags(list):