web/form.py
branchtls-sprint
changeset 1304 8975c8e520a9
parent 1289 5eff2ef92977
child 1305 395ef7f2b95b
--- a/web/form.py	Wed Apr 08 20:30:58 2009 +0200
+++ b/web/form.py	Wed Apr 08 20:34:26 2009 +0200
@@ -209,15 +209,14 @@
     cssclass = None
     cssstyle = None
     cwtarget = None
-    buttons = None
     redirect_path = None
     set_error_url = True
     copy_nav_params = False
+    form_buttons = None # form buttons (button widgets instances)
                  
     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():
             assert hasattr(self.__class__, key) and not key[0] == '_', key
             setattr(self, key, val)
@@ -290,6 +289,7 @@
             values.update(previous_values)
         for field in self.fields:
             for field in field.actual_fields(self):
+                field.form_init(self)
                 value = self.form_field_value(field, values)
                 context[field] = {'value': field.format_value(self.req, value),
                                   'rawvalue': value,
@@ -335,9 +335,6 @@
     def form_field_vocabulary(self, field, limit=None):
         raise NotImplementedError
 
-    def form_buttons(self):
-        return self.buttons
-
    
 class EntityFieldsForm(FieldsForm):
     __select__ = (match_kwargs('entity') | (one_line_rset & non_final_entity()))