Package turbogears :: Package widgets :: Module forms :: Class RepeatingInputWidget

Class RepeatingInputWidget

source code

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

Base class for a compound widget which can be repeated.

Nested Classes

Inherited from base.Widget: __metaclass__

Instance Methods
 
update_params(self, d)
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
 
dictify_value(self, value)
Convert list of values into a list of dicts suitable for propagating values to child widgets.
source code

Inherited from CompoundInputWidget: adjust_value, error_for

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

Inherited from base.Widget: __call__, __repr__, __setattr__

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

Class Variables
  repeating = True
hash(x)
  params = ['repetitions', 'convert']
  params_doc = {'convert': 'Should the value be coerced by the v...
  repetitions = 1

Inherited from base.CompoundWidget: compound, member_widgets

Inherited from InputWidget: convert, validator

Inherited from base.Widget: css, default, engine_name, 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, 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)

value_for(self, item, value)

source code 

Return the value for a child widget.

``item`` is the child widget instance or its 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 its name, ``params`` is a dict containing the parameters passed to this compound widget.

Overrides: base.CompoundWidget.params_for

dictify_value(self, value)

source code 

Convert list of values into a list of dicts suitable for propagating values to child widgets.

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

Overrides: CompoundInputWidget.dictify_value

Class Variable Details

params_doc

Value:
{'convert': 'Should the value be coerced by the validator at display?'\
,
 'repetitions': 'Number of repetitions that should be rendered'}