# HG changeset patch # User Katia Saurfelt # Date 1254208934 -7200 # Node ID ff945c7013d99b26e40c5bfd020e7635ed0eaeec # Parent f0ec5d17f470d348331bd9948690bd3f729a4c8d [form] make EntityFormRenderer a little bit easier to override diff -r f0ec5d17f470 -r ff945c7013d9 web/views/formrenderers.py --- a/web/views/formrenderers.py Mon Sep 28 18:58:12 2009 +0200 +++ b/web/views/formrenderers.py Tue Sep 29 09:22:14 2009 +0200 @@ -371,16 +371,19 @@ # needs some additional points in some case (XXX explain cases) __select__ = EntityBaseFormRenderer.__select__ & yes() - _options = FormRenderer._options + ('display_relations_form',) + _options = FormRenderer._options + ('display_relations_form', 'main_form_title') display_relations_form = True + main_form_title = _('main information') def render(self, form, values): rendered = super(EntityFormRenderer, self).render(form, values) return rendered + u'' # close extra div introducted by open_form def open_form(self, form, values): - attrs_fs_label = ('
%s
' - % self.req._('main informations')) + attrs_fs_label = '' + if self.main_form_title: + attrs_fs_label += ('
%s
' + % self.req._(self.main_form_title)) attrs_fs_label += '
' return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values)