Package tdi :: Package tools :: Package htmlform :: Module _interfaces :: Class ParameterAdapterInterface
[frames] | no frames]

Class ParameterAdapterInterface

source code

object --+
         |
        ParameterAdapterInterface

Interface for a request parameter adapter suitable for HTMLForm
Instance Methods
list
getlist(self, name)
Determine all parameters submitted under a name
source code
basestring
getfirst(self, name, default=None)
Determine one parameter of all submitted under a name
source code

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

Properties

Inherited from object: __class__

Method Details

getlist(self, name)

source code 
Determine all parameters submitted under a name
Parameters:
  • name (str) - The name to look up
Returns: list
The List of values (maybe empty) ([u'value', ...])

getfirst(self, name, default=None)

source code 

Determine one parameter of all submitted under a name

It doesn't have to be the first parameter, but it should work deterministically, i.e. the method should always return the same value for the same name.

Parameters:
  • name (str) - The name to look up
  • default (basestring) - The returned value if name could not be found
Returns: basestring
The found value. If it was not found, default is returned