web/views/editforms.py
branchtls-sprint
changeset 1579 4eea314694e2
parent 1576 3bfcf1e4eb26
child 1629 cfbcf96ea054
--- a/web/views/editforms.py	Thu Apr 30 12:36:33 2009 +0200
+++ b/web/views/editforms.py	Thu Apr 30 12:36:48 2009 +0200
@@ -92,13 +92,19 @@
                 "'%(eid)s', '%(divid)s', %(reload)s);")
     ondblclick = "showInlineEditionForm(%(eid)s, '%(rtype)s', '%(divid)s')"
 
-    def cell_call(self, row, col, rtype=None, role='subject', reload=False):
+    def cell_call(self, row, col, rtype=None, role='subject', reload=False,
+                  vid='autolimited'):
         """display field to edit entity's `rtype` relation on double-click"""
+        rschema = self.schema.rschema(rtype)
         entity = self.entity(row, col)
-        if getattr(entity, rtype) is None:
-            value = self.req._('not specified')
+        if rschema.is_final():
+            if getattr(entity, rtype) is None:
+                value = self.req._('not specified')
+            else:
+                value = entity.printable_value(rtype)
         else:
-            value = entity.printable_value(rtype)
+            rset = entity.related(rtype, role)
+            value = self.view(vid, rset, 'null')
         if not entity.has_perm('update'):
             self.w(value)
             return