--- a/cwvreg.py Thu Aug 27 13:02:45 2009 +0200
+++ b/cwvreg.py Mon Aug 31 19:09:54 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, class_regid
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
@@ -318,8 +324,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: