hooks/metadata.py
changeset 5174 78438ad513ca
parent 5066 bf5cbc351e99
child 5423 e15abfdcce38
equal deleted inserted replaced
5173:73760bbb66bd 5174:78438ad513ca
   100 
   100 
   101 class _SyncOwnersOp(hook.Operation):
   101 class _SyncOwnersOp(hook.Operation):
   102     def precommit_event(self):
   102     def precommit_event(self):
   103         self.session.execute('SET X owned_by U WHERE C owned_by U, C eid %(c)s,'
   103         self.session.execute('SET X owned_by U WHERE C owned_by U, C eid %(c)s,'
   104                              'NOT EXISTS(X owned_by U, X eid %(x)s)',
   104                              'NOT EXISTS(X owned_by U, X eid %(x)s)',
   105                              {'c': self.compositeeid, 'x': self.composedeid},
   105                              {'c': self.compositeeid, 'x': self.composedeid})
   106                              ('c', 'x'))
       
   107 
   106 
   108 
   107 
   109 class SyncCompositeOwner(MetaDataHook):
   108 class SyncCompositeOwner(MetaDataHook):
   110     """when adding composite relation, the composed should have the same owners
   109     """when adding composite relation, the composed should have the same owners
   111     has the composite
   110     has the composite