yams api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Dec 2009 18:05:10 +0100
changeset 4052 0c39ffd789ed
parent 4051 eec34250a645
child 4053 7cc66b1d9183
yams api update
hooks/syncschema.py
--- 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,