make it easier to inherit from EditionFormView stable
authorFlorent Cayré <florent.cayre@gmail.com>
Thu, 31 Mar 2011 09:17:43 +0200
branchstable
changeset 7149 9dfd0dea692b
parent 7145 8dd94fa7310a
child 7150 8f9f542622d9
child 7151 04d0624a1832
make it easier to inherit from EditionFormView
web/views/editforms.py
--- a/web/views/editforms.py	Wed Mar 30 15:09:13 2011 +0200
+++ b/web/views/editforms.py	Thu Mar 31 09:17:43 2011 +0200
@@ -99,6 +99,7 @@
     # add yes() so it takes precedence over deprecated views in baseforms,
     # though not baseforms based customized view
     __select__ = one_line_rset() & non_final_entity() & yes()
+    form_id = 'edition'
 
     title = _('modification')
 
@@ -109,7 +110,8 @@
     def render_form(self, entity):
         """fetch and render the form"""
         self.form_title(entity)
-        form = self._cw.vreg['forms'].select('edition', self._cw, entity=entity,
+        form = self._cw.vreg['forms'].select(self.form_id, self._cw,
+                                             entity=entity,
                                              submitmsg=self.submited_message())
         self.init_form(form, entity)
         form.render(w=self.w)