hooks/syncschema.py
changeset 4052 0c39ffd789ed
parent 4043 39ae94e0c8b8
child 4054 03c9a539d282
--- a/hooks/syncschema.py	Tue Dec 08 18:04:57 2009 +0100
+++ b/hooks/syncschema.py	Tue Dec 08 18:05:10 2009 +0100
@@ -1070,13 +1070,13 @@
             return
         schema = self._cw.vreg.schema
         entity = self._cw.entity_from_eid(self.eidto)
-        subjtype, rtype, objtype = schema.schema_by_eid(self.eidfrom)
+        rdef = schema.schema_by_eid(self.eidfrom)
         try:
-            cstr = rtype.rdef(subjtype, objtype).constraint_by_type(
-                entity.cstrtype[0].name)
+            cstr = rdef.constraint_by_type(entity.type)
         except IndexError:
             self._cw.critical('constraint type no more accessible')
         else:
+            subjtype, rtype, objtype = rdef.as_triple()
             SourceDbCWConstraintDel(self._cw, subjtype=subjtype, rtype=rtype,
                                     objtype=objtype, cstr=cstr)
             MemSchemaCWConstraintDel(self._cw, subjtype=subjtype, rtype=rtype,