Package turbogears :: Package widgets :: Module forms :: Class Form

Class Form

source code

     object --+                
    base.Widget --+            
base.CompoundWidget --+        
     object --+       |        
              |       |        
    base.Widget --+   |        
                  |   |        
        InputWidget --+        
    CompoundInputWidget --+    
        FormFieldsContainer --+
Known Subclasses:

Nested Classes

Inherited from base.Widget: __metaclass__

Instance Methods
update_params(self, d)
Update the template parameters.
source code
validate(self, value, state=None) source code

Inherited from FormFieldsContainer: display_field_for, get_field_by_name, render_field_for

Inherited from CompoundInputWidget: adjust_value, dictify_value, error_for, params_for, value_for

Inherited from base.CompoundWidget: __init__, display, iter_member_widgets, retrieve_css, retrieve_javascript

Inherited from base.Widget: __call__, __repr__, __setattr__, render

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Class Variables
  form = True
  name = 'form'
  member_widgets = ['submit', 'fields', 'hidden_fields']
  params = ['action', 'method', 'form_attrs', 'use_name', 'submi...
  params_doc = {'action': 'Url to POST/GET the form data', 'conv...
  submit = SubmitButton(name='widget', attrs={}, field_class='su...
  action = ''
  method = 'post'
  form_attrs = {}
  use_name = False
  submit_text = None

Inherited from FormFieldsContainer: disabled_fields, fields, hidden_fields

Inherited from base.CompoundWidget: compound

Inherited from InputWidget: convert, validator

Inherited from base.Widget: css, default, javascript, template


Inherited from FormFieldsContainer: file_upload

Inherited from InputWidget: error, fq_name, is_validated, name_path, path

Inherited from base.Widget: is_named

Inherited from object: __class__

Method Details

update_params(self, d)

source code 

Update the template parameters.

This method will have the last chance to update the variables sent to the template for the specific request. All parameters listed at class attribute 'params' will be available at the 'params' dict this method receives.

*Must* call super(MyWidget, self).update_params(params) cooperatively, unless, of course, your know what you're doing. Preferably this should be done before any actual work is done in the method.

Overrides: base.Widget.update_params
(inherited documentation)

Class Variable Details




{'action': 'Url to POST/GET the form data',
 'convert': 'Should the value be coerced by the validator at display?'\
 'disabled_fields': 'List of names of the fields we want to disable',
 'form_attrs': 'Extra (X)HTML attributes for the form tag',
 'method': 'HTTP request method',
 'submit_text': 'Text for the submit button',
 'use_name': 'Whether to use the name instead of the id attribute'}


SubmitButton(name='widget', attrs={}, field_class='submitbutton', css_\
classes=[], convert=True)

Property Details


Get Method: