[hooks] do not abuse of inheritance for CWRType hooks
Just copy the selector to ease readability.
--- 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):