If any cube has a 'includeme' attribute, call config.include on it
authorChristophe de Vienne <christophe@unlish.com>
Wed, 27 Aug 2014 19:26:44 +0200
changeset 11502 e4682c567e86
parent 11501 fcf7f99fad4a
child 11503 ddf61aa73384
If any cube has a 'includeme' attribute, call config.include on it Related to #4291181
pyramid_cubicweb/core.py
--- a/pyramid_cubicweb/core.py	Thu Aug 21 21:55:58 2014 +0200
+++ b/pyramid_cubicweb/core.py	Wed Aug 27 19:26:44 2014 +0200
@@ -191,3 +191,11 @@
         _cw_cnx, name='cw_cnx', property=True, reify=True)
     config.add_request_method(
         _cw_request, name='cw_request', property=True, reify=True)
+
+    cwcfg = config.registry['cubicweb.config']
+    for cube in cwcfg.cubes():
+        pkgname = 'cubes.' + cube
+        mod = __import__(pkgname)
+        mod = getattr(mod, cube)
+        if hasattr(mod, 'includeme'):
+            config.include('cubes.' + cube)