cwvreg.py
branchstable
changeset 3057 f4ba5a251ab7
parent 3055 06814d57514f
child 3071 6ad4e6d4df86
child 3172 9341ab8f1d1a
--- a/cwvreg.py	Mon Aug 31 14:26:44 2009 +0200
+++ b/cwvreg.py	Mon Aug 31 14:27:16 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