Package turbogears :: Package widgets :: Module forms :: Class CompoundInputWidget

Class CompoundInputWidget

source code

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

Nested Classes

Inherited from base.Widget: __metaclass__

Instance Methods
 
update_params(self, params)
Update the template parameters.
source code
 
value_for(self, item, value)
Return the value for a child widget.
source code
 
params_for(self, item, **params)
Return the parameters for a child widget.
source code
 
error_for(self, item, suppress_errors=False)
Return the Invalid exception associated with a child widget.
source code
 
dictify_value(self, value)
Convert value into a dict suitable for propagating values to child widgets.
source code
 
adjust_value(self, value=None, **params)
Adjust a value for displaying in a widget.
source code

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
  params = ['convert']
  params_doc = {'convert': 'Should the value be coerced by the v...

Inherited from base.CompoundWidget: compound, member_widgets

Inherited from InputWidget: convert, validator

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

Properties

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, params)

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)

value_for(self, item, value)

source code 

Return the value for a child widget.

``item`` is the child widget instance or it's name, ``value`` is a dict containing the value for this compound widget.

Overrides: base.CompoundWidget.value_for

params_for(self, item, **params)

source code 

Return the parameters for a child widget.

``item`` is the child widget instance or it's name, ``params`` is a dict containing the parameters passed to this compound widget.

Overrides: base.CompoundWidget.params_for

error_for(self, item, suppress_errors=False)

source code 

Return the Invalid exception associated with a child widget.

The exception is stored in the request local storage. ``item`` is the child widget instance or it's name.

dictify_value(self, value)

source code 

Convert value into a dict suitable for propagating values to child widgets.

If value is a dict it will pass through, if it's another kind of object, attributes which match child widgets' names will tried to be fetched.

adjust_value(self, value=None, **params)

source code 

Adjust a value for displaying in a widget.

Overrides: base.Widget.adjust_value

Class Variable Details

params_doc

Value:
{'convert': 'Should the value be coerced by the validator at display?'\
}