cwvreg.py
branch3.5
changeset 3071 6ad4e6d4df86
parent 3032 f0ae6a5aba3e
parent 3057 f4ba5a251ab7
child 3072 6fb42c53f6df
child 3137 5598bec9be7f
child 3184 613064b49331
--- a/cwvreg.py	Fri Aug 28 16:28:26 2009 +0200
+++ b/cwvreg.py	Mon Aug 31 18:59:10 2009 +0200
@@ -16,12 +16,18 @@
 
 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
                       ObjectNotFound, NoSelectableObject, RegistryNotFound,
-                      RegistryOutOfDate, CW_EVENT_MANAGER)
+                      RegistryOutOfDate, CW_EVENT_MANAGER, onevent)
 from cubicweb.utils import dump_class
 from cubicweb.vregistry import VRegistry, Registry
 from cubicweb.rtags import RTAGS
 
 
+@onevent('before-registry-reload')
+def clear_rtag_objects():
+    for rtag in RTAGS:
+        rtag.clear()
+
+
 def use_interfaces(obj):
     """return interfaces used by the given object by searchinf for implements
     selectors, with a bw compat fallback to accepts_interfaces attribute
@@ -310,8 +316,8 @@
         else:
             self._needs_iface[obj] = ifaces
 
-    def register(self, obj, **kwargs):
-        super(CubicWebVRegistry, self).register(obj, **kwargs)
+    def register(self, obj, *args, **kwargs):
+        super(CubicWebVRegistry, self).register(obj, *args, **kwargs)
         # XXX bw compat
         ifaces = use_interfaces(obj)
         if ifaces: