web/views/primary.py
changeset 8666 1dd655788ece
parent 8665 e65af61bde7d
child 8736 b84a233cb8b0
--- a/web/views/primary.py	Thu Jan 10 18:34:10 2013 +0100
+++ b/web/views/primary.py	Mon Jan 21 16:34:09 2013 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -97,8 +97,8 @@
     title = _('primary')
     show_attr_label = True
     show_rel_label = True
-    rsection = uicfg.primaryview_section
-    display_ctrl = uicfg.primaryview_display_ctrl
+    rsection = None
+    display_ctrl = None
     main_related_section = True
 
     def html_headers(self):
@@ -111,6 +111,13 @@
 
     def entity_call(self, entity):
         entity.complete()
+        uicfg_reg = self._cw.vreg['uicfg']
+        if self.rsection is None:
+            self.rsection = uicfg_reg.select('primaryview_section',
+                                             self._cw, entity=entity)
+        if self.display_ctrl is None:
+            self.display_ctrl = uicfg_reg.select('primaryview_display_ctrl',
+                                                 self._cw, entity=entity)
         self.render_entity(entity)
 
     def render_entity(self, entity):