[reledit] honore 'rvid' for attribute relations (closes #1947471) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 22 Sep 2011 17:20:52 +0200
branchstable
changeset 7834 258fc0b4a1e0
parent 7833 f19e3203dff6
child 7835 c071e0b70bf5
[reledit] honore 'rvid' for attribute relations (closes #1947471)
web/views/reledit.py
--- a/web/views/reledit.py	Thu Sep 22 17:20:41 2011 +0200
+++ b/web/views/reledit.py	Thu Sep 22 17:20:52 2011 +0200
@@ -104,7 +104,11 @@
                 self._handle_relation(rschema, role, divid, reload, formid, action)
 
     def _handle_attribute(self, rschema, role, divid, reload, action):
-        value = self.entity.printable_value(rschema.type)
+        rvid = self._rules.get('rvid', None)
+        if rvid is not None:
+            value = self._cw.view(rvid, entity=self.entity, rtype=rschema.type)
+        else:
+            value = self.entity.printable_value(rschema.type)
         if not self._should_edit_attribute(rschema):
             self.w(value)
             return