Package web :: Package web :: Module form :: Class Dropdown
[hide private]
[frames] | no frames]

Class Dropdown

source code

object --+    
         |    
     Input --+
             |
            Dropdown

Dropdown/select input.

>>> Dropdown(name='foo', args=['a', 'b', 'c'], value='b').render()
'<select id="foo" name="foo">\n  <option value="a">a</option>\n  <option selected="selected" value="b">b</option>\n  <option value="c">c</option>\n</select>\n'
>>> Dropdown(name='foo', args=[('a', 'aa'), ('b', 'bb'), ('c', 'cc')], value='b').render()
'<select id="foo" name="foo">\n  <option value="a">aa</option>\n  <option selected="selected" value="b">bb</option>\n  <option value="c">cc</option>\n</select>\n'
Instance Methods [hide private]
 
__init__(self, name, args, *validators, **attrs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
render(self) source code

Inherited from Input: addatts, get_default_id, get_type, get_value, is_hidden, rendernote, set_value, validate

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, args, *validators, **attrs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

render(self)

source code 
Overrides: Input.render