consider primaryview_display_ctrl in reledit, XXX should split into reledit / autoreledit stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Jul 2009 19:51:19 +0200
branchstable
changeset 2370 1e8ce077b62a
parent 2369 5a2b8ed266ca
child 2373 50e01ff07f06
consider primaryview_display_ctrl in reledit, XXX should split into reledit / autoreledit
web/views/editforms.py
--- a/web/views/editforms.py	Fri Jul 10 12:15:09 2009 +0200
+++ b/web/views/editforms.py	Fri Jul 10 19:51:19 2009 +0200
@@ -20,7 +20,7 @@
 from cubicweb.utils import make_uid, compute_cardinality, get_schema_property
 from cubicweb.view import EntityView
 from cubicweb.common import tags
-from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param
+from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param, uicfg
 from cubicweb.web.form import FormViewMixIn
 from cubicweb.web.formfields import guess_field
 from cubicweb.web.formwidgets import Button, SubmitButton, ResetButton
@@ -87,7 +87,6 @@
     """
     id = 'reledit'
     __select__ = non_final_entity() & match_kwargs('rtype')
-
     # FIXME editableField class could be toggleable from userprefs
 
     _onclick = u"showInlineEditionForm(%(eid)s, '%(rtype)s', '%(divid)s')"
@@ -126,6 +125,11 @@
             form = self._build_attribute_form(entity, value, rtype, role, reload,
                                               row, col, default, landing_zone)
         else:
+            vid = uicfg.primaryview_display_ctrl.etype_get(entity.e_schema,
+                                                           rtype, role)
+            if vid != 'reledit': # reledit explicitly disabled
+                self.wview(vid, entity.related(rtype, role))
+                return
             if rvid is None:
                 rvid = self._compute_best_vid(entity, rtype, role)
             rset = entity.related(rtype, role)