hooks/syncschema.py
branchstable
changeset 9565 fa00fc251d57
parent 9559 072429be2d95
child 9600 bde625698f44
equal deleted inserted replaced
9564:e2d5b0712974 9565:fa00fc251d57
  1166 
  1166 
  1167     def __call__(self):
  1167     def __call__(self):
  1168         if self._cw.deleted_in_transaction(self.eidfrom):
  1168         if self._cw.deleted_in_transaction(self.eidfrom):
  1169             return
  1169             return
  1170         schema = self._cw.vreg.schema
  1170         schema = self._cw.vreg.schema
  1171         entity = self._cw.entity_from_eid(self.eidto)
       
  1172         rdef = schema.schema_by_eid(self.eidfrom)
  1171         rdef = schema.schema_by_eid(self.eidfrom)
  1173         try:
  1172         try:
  1174             cstr = rdef.constraint_by_type(entity.type)
  1173             cstr = rdef.constraint_by_eid(self.eidto)
  1175         except IndexError:
  1174         except ValueError:
  1176             self._cw.critical('constraint type no more accessible')
  1175             self._cw.critical('constraint no more accessible')
  1177         else:
  1176         else:
  1178             CWConstraintDelOp(self._cw, rdef=rdef, oldcstr=cstr)
  1177             CWConstraintDelOp(self._cw, rdef=rdef, oldcstr=cstr)
  1179 
  1178 
  1180 # unique_together constraints
  1179 # unique_together constraints
  1181 # XXX: use setoperations and before_add_relation here (on constraint_of and relations)
  1180 # XXX: use setoperations and before_add_relation here (on constraint_of and relations)