hooks/syncschema.py
branchstable
changeset 7021 fc7ac3409b0c
parent 6954 f9a84d54ebf3
child 7181 e54ad6984e01
equal deleted inserted replaced
7014:7e3e80f4179a 7021:fc7ac3409b0c
  1125 # unique_together constraints
  1125 # unique_together constraints
  1126 # XXX: use setoperations and before_add_relation here (on constraint_of and relations)
  1126 # XXX: use setoperations and before_add_relation here (on constraint_of and relations)
  1127 class AfterAddCWUniqueTogetherConstraintHook(SyncSchemaHook):
  1127 class AfterAddCWUniqueTogetherConstraintHook(SyncSchemaHook):
  1128     __regid__ = 'syncadd_cwuniquetogether_constraint'
  1128     __regid__ = 'syncadd_cwuniquetogether_constraint'
  1129     __select__ = SyncSchemaHook.__select__ & is_instance('CWUniqueTogetherConstraint')
  1129     __select__ = SyncSchemaHook.__select__ & is_instance('CWUniqueTogetherConstraint')
  1130     events = ('after_add_entity', 'after_update_entity')
  1130     events = ('after_add_entity',)
  1131 
  1131 
  1132     def __call__(self):
  1132     def __call__(self):
  1133         CWUniqueTogetherConstraintAddOp(self._cw, entity=self.entity)
  1133         CWUniqueTogetherConstraintAddOp(self._cw, entity=self.entity)
  1134 
  1134 
  1135 
  1135