--- 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