handle __message in FieldsForm, not only in EntityFieldsForm tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 07 Apr 2009 19:52:52 +0200
branchtls-sprint
changeset 1271 0a5257f5d723
parent 1270 53f35db66f88
child 1272 e710fc46c6a0
handle __message in FieldsForm, not only in EntityFieldsForm
web/form.py
--- a/web/form.py	Tue Apr 07 19:52:25 2009 +0200
+++ b/web/form.py	Tue Apr 07 19:52:52 2009 +0200
@@ -208,7 +208,8 @@
     set_error_url = True
     copy_nav_params = False
                  
-    def __init__(self, req, rset=None, row=None, col=None, **kwargs):
+    def __init__(self, req, rset=None, row=None, col=None, submitmsg=None,
+                 **kwargs):
         super(FieldsForm, self).__init__(req, rset, row=row, col=col)
         self.buttons = kwargs.pop('buttons', [])
         for key, val in kwargs.items():
@@ -222,6 +223,8 @@
                 value = kwargs.get(param, req.form.get(param))
                 if value:
                     self.form_add_hidden(param, initial=value)
+        if submitmsg is not None:
+            self.form_add_hidden('__message', submitmsg)
         self.context = None
 
     @iclassmethod