assert primary key exists in record before attempting to delete it
[plcapi.git] / PLC / AddressTypes.py
index 3e41a92..3443871 100644 (file)
@@ -9,7 +9,7 @@ from types import StringTypes
 from PLC.Faults import *
 from PLC.Parameter import Parameter
 from PLC.Filter import Filter
-from PLC.Storage.AlchemyObj import AlchemyObj
+from PLC.Storage.AlchemyObject import AlchemyObj
 from PLC.Table import Row, Table
 
 class AddressType(AlchemyObj):
@@ -48,6 +48,7 @@ class AddressType(AlchemyObj):
 
 
     def delete(self, commit=True):
+        assert 'address_type_id' in self
         AlchemyObj.delete(self, dict(self))
 
 class AddressTypes(list):