web/views/primary.py
branchstable
changeset 6090 887c069d88df
parent 6086 2b53a8669c98
child 6092 ab4958e2654b
child 6093 9001a74fcc82
--- a/web/views/primary.py	Tue Aug 10 14:56:31 2010 +0200
+++ b/web/views/primary.py	Tue Aug 10 18:26:43 2010 +0200
@@ -271,6 +271,19 @@
             label = display_name(self._cw, rschema.type, role)
         self.field(label, value, show_label=showlabel, tr=False, table=table)
 
+    def _rel_label(self, entity, rschema, role, dispctrl):
+        if rschema.final:
+            showlabel = dispctrl.get('showlabel', self.show_attr_label)
+        else:
+            showlabel = dispctrl.get('showlabel', self.show_rel_label)
+        if showlabel:
+            if dispctrl.get('label'):
+                label = self._cw._(dispctrl['label'])
+            else:
+                label = display_name(self._cw, rschema.type, role,
+                                     context=entity.__regid__)
+            return label
+        return u''
 
 class RelatedView(EntityView):
     __regid__ = 'autolimited'