[primary] use a new rtypevid flag in primary view display controller, allowing to tell the view for a non final relation should be called as an attribute view (eg, not on the target rset) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 06 Aug 2010 17:32:43 +0200
branchstable
changeset 6070 0ca78eb1a3c2
parent 6065 eae118a84cc6
child 6071 c7a9e25153c2
[primary] use a new rtypevid flag in primary view display controller, allowing to tell the view for a non final relation should be called as an attribute view (eg, not on the target rset)
web/views/primary.py
--- a/web/views/primary.py	Wed Aug 04 11:23:19 2010 +0200
+++ b/web/views/primary.py	Fri Aug 06 17:32:43 2010 +0200
@@ -129,7 +129,7 @@
         display_attributes = []
         for rschema, _, role, dispctrl in self._section_def(entity, 'attributes'):
             vid = dispctrl.get('vid', 'reledit')
-            if rschema.final or vid == 'reledit':
+            if rschema.final or vid == 'reledit' or dispctrl.get('rtypevid'):
                 value = entity.view(vid, rtype=rschema.type, role=role)
             else:
                 rset = self._relation_rset(entity, rschema, role, dispctrl)