# HG changeset patch # User Sylvain Thénault # Date 1255342841 -7200 # Node ID 9b16e7b6ba35a99034d7083875fa90d248a814dd # Parent a56759c3c99f8a690b4c779e0895763e8ae8e5e4 [reledit] display value anyway when should not edit attribute/relation diff -r a56759c3c99f -r 9b16e7b6ba35 web/views/editforms.py --- a/web/views/editforms.py Mon Oct 12 12:19:58 2009 +0200 +++ b/web/views/editforms.py Mon Oct 12 12:20:41 2009 +0200 @@ -176,6 +176,7 @@ entity, rtype, role, 'edition', default, onsubmit, reload, attrcategories=self.attrcategories) if not self.should_edit_attribute(entity, rschema, role, form): + self.w(self.entity.printable_value(rtype)) return value = entity.printable_value(rtype) or default self.attribute_form(lzone, value, form, @@ -183,13 +184,15 @@ else: if rvid is None: rvid = self._compute_best_vid(entity.e_schema, rschema, role) - if not self.should_edit_relation(entity, rschema, role, rvid): - return rset = entity.related(rtype, role) if rset: value = self.view(rvid, rset) else: value = default + if not self.should_edit_relation(entity, rschema, role, rvid): + if rset: + self.w(value) + return onsubmit = ("return inlineValidateRelationForm('%(rtype)s', '%(role)s', '%(eid)s', " "'%(divid)s', %(reload)s, '%(vid)s', '%(default)s', '%(lzone)s');") form = self._build_form(