# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1241087808 -7200 # Node ID 4eea314694e2d7e4c23ee2c1bc0d2faf73861047 # Parent 73af05429cb425840000a9dbf155acd88dfb88e8 apply on non final relation diff -r 73af05429cb4 -r 4eea314694e2 web/views/editforms.py --- 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