Package gluon :: Module validators :: Class ANY_OF
[hide private]
[frames] | no frames]

Class ANY_OF

source code

object --+    
         |    
 Validator --+
             |
            ANY_OF

test if any of the validators in a list return successfully

>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('a@b.co')
('a@b.co', None)
>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('abco')
('abco', None)
>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('@ab.co')
('@ab.co', 'enter only letters, numbers, and underscore')
>>> ANY_OF([IS_ALPHANUMERIC(),IS_EMAIL()])('@ab.co')
('@ab.co', 'enter a valid email address')
Instance Methods [hide private]
 
__init__(self, subs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__call__(self, value) source code
 
formatter(self, value)
For some validators returns a formatted version (matching the validator) of value.
source code

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, subs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__call__(self, value)
(Call operator)

source code 
Overrides: Validator.__call__

formatter(self, value)

source code 

For some validators returns a formatted version (matching the validator) of value. Otherwise just returns the value.

Overrides: Validator.formatter
(inherited documentation)