# HG changeset patch # User Laura Médioni # Date 1403863217 -7200 # Node ID 6359f3121f3fe7f2c5b8ba28cc368cd8c029f6e6 # Parent 6047bf8df9e53d82af7839ac24d2b77dba0c8ad8 [hooks] do not abuse of inheritance for CWRType hooks Just copy the selector to ease readability. diff -r 6047bf8df9e5 -r 6359f3121f3f hooks/syncschema.py --- a/hooks/syncschema.py Mon Jun 16 10:08:18 2014 +0200 +++ b/hooks/syncschema.py Fri Jun 27 12:00:17 2014 +0200 @@ -985,7 +985,7 @@ MemSchemaCWRTypeDel(self._cw, rtype=name) -class AfterAddCWRTypeHook(DelCWRTypeHook): +class AfterAddCWRTypeHook(SyncSchemaHook): """after a CWRType entity has been added: * register an operation to add the relation type to the instance's schema on commit @@ -993,6 +993,7 @@ We don't know yet this point if a table is necessary """ __regid__ = 'syncaddcwrtype' + __select__ = SyncSchemaHook.__select__ & is_instance('CWRType') events = ('after_add_entity',) def __call__(self): @@ -1005,9 +1006,10 @@ MemSchemaCWRTypeAdd(self._cw, rtypedef=rtypedef) -class BeforeUpdateCWRTypeHook(DelCWRTypeHook): +class BeforeUpdateCWRTypeHook(SyncSchemaHook): """check name change, handle final""" __regid__ = 'syncupdatecwrtype' + __select__ = SyncSchemaHook.__select__ & is_instance('CWRType') events = ('before_update_entity',) def __call__(self):