Package gluon :: Module html :: Class INPUT
[hide private]
[frames] | no frames]

Class INPUT

source code

  object --+        
           |        
XmlComponent --+    
               |    
             DIV --+
                   |
                  INPUT
Known Subclasses:


INPUT Component

Takes two special attributes value= and requires=.

Args:
    value: used to pass the initial value for the input field.
        value differs from _value because it works for checkboxes, radio,
        textarea and select/option too.
        For a checkbox value should be '' or 'on'.
        For a radio or select/option value should be the _value
        of the checked/selected item.

    requires: should be None, or a validator or a list of validators
        for the value of the field.

Examples:

>>> INPUT(_type='text', _name='name', value='Max').xml()
'<input name="name" type="text" value="Max" />'

>>> INPUT(_type='checkbox', _name='checkbox', value='on').xml()
'<input checked="checked" name="checkbox" type="checkbox" value="on" />'

>>> INPUT(_type='radio', _name='radio', _value='yes', value='yes').xml()
'<input checked="checked" name="radio" type="radio" value="yes" />'

>>> INPUT(_type='radio', _name='radio', _value='no', value='yes').xml()
'<input name="radio" type="radio" value="no" />'


    

Instance Methods [hide private]
 
_validate(self)
nothing to validate yet.
source code
 
_postprocessing(self)
Handling of attributes (normally the ones not prefixed with '_').
source code
 
xml(self)
generates the xml for this component.
source code

Inherited from DIV: __delitem__, __getitem__, __init__, __len__, __nonzero__, __setitem__, __str__, append, element, elements, flatten, insert, sibling, siblings, update

Inherited from DIV (private): _fixup, _setnode, _traverse, _wrap_components, _xml

Inherited from XmlComponent: __add__, __mul__, add_class, remove_class

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

Class Variables [hide private]
  tag = 'input/'

Inherited from DIV: regex_attr, regex_class, regex_id, regex_tag

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_validate(self)

source code 

nothing to validate yet. May be overridden by subclasses

Overrides: DIV._validate
(inherited documentation)

_postprocessing(self)

source code 

Handling of attributes (normally the ones not prefixed with '_').

Nothing to postprocess yet. May be overridden by subclasses

Overrides: DIV._postprocessing
(inherited documentation)

xml(self)

source code 

generates the xml for this component.

Overrides: XmlComponent.xml