Commit c5d0eb42 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Backport change for cubicweb #15755515

parent e6c7685a6b3b
......@@ -74,3 +74,31 @@ def field_by_name(cls_or_self, name, role=None, eschema=None):
if field is None:
raise
return field
# allow configuration of inlined form renderer using a class attribute #############################
# (https://www.cubicweb.org/ticket/15755515)
from logilab.common.decorators import cached # noqa
from cubicweb.web.views import autoform # noqa
autoform.InlineEntityEditionFormView.form_renderer_id = 'inline'
@monkeypatch(autoform.InlineEntityEditionFormView, methodname='form')
@property
@cached
def form(self):
entity = self._entity()
form = self._cw.vreg['forms'].select('edition', self._cw,
entity=entity,
formtype='inlined',
form_renderer_id=self.form_renderer_id,
copy_nav_params=False,
mainform=False,
parent_form=self.pform,
**self.cw_extra_kwargs)
if self.pform is None:
form.restore_previous_post(form.session_key())
self.add_hiddens(form, entity)
return form
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment