web/views/primary.py
branchstable
changeset 6086 2b53a8669c98
parent 6070 0ca78eb1a3c2
child 6089 b0975c6f2e44
child 6090 887c069d88df
--- a/web/views/primary.py	Tue Aug 10 14:20:21 2010 +0200
+++ b/web/views/primary.py	Tue Aug 10 14:21:32 2010 +0200
@@ -130,7 +130,8 @@
         for rschema, _, role, dispctrl in self._section_def(entity, 'attributes'):
             vid = dispctrl.get('vid', 'reledit')
             if rschema.final or vid == 'reledit' or dispctrl.get('rtypevid'):
-                value = entity.view(vid, rtype=rschema.type, role=role)
+                value = entity.view(vid, rtype=rschema.type, role=role,
+                                    initargs={'dispctrl': dispctrl})
             else:
                 rset = self._relation_rset(entity, rschema, role, dispctrl)
                 if rset:
@@ -153,6 +154,16 @@
 
     def render_entity_relations(self, entity):
         for rschema, tschemas, role, dispctrl in self._section_def(entity, 'relations'):
+            if rschema.final:
+                self.w(u'<div class="section">')
+                label = self._rel_label(entity, rschema, role, dispctrl)
+                if label:
+                    self.w(u'<h4>%s</h4>' % label)
+                vid = dispctrl.get('vid', 'reledit')
+                entity.view(vid, rtype=rschema.type, role=role, w=self.w,
+                            initargs={'dispctrl': dispctrl})
+                self.w(u'</div>')
+                continue
             rset = self._relation_rset(entity, rschema, role, dispctrl)
             if rset:
                 try: