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

Class IS_IN_SET

source code

object --+    
         |    
 Validator --+
             |
            IS_IN_SET
Known Subclasses:

example:

   INPUT(_type='text', _name='name',
         requires=IS_IN_SET(['max', 'john'],zero=''))

the argument of IS_IN_SET must be a list or set

>>> IS_IN_SET(['max', 'john'])('max')
('max', None)
>>> IS_IN_SET(['max', 'john'])('massimo')
('massimo', 'value not allowed')
>>> IS_IN_SET(['max', 'john'], multiple=True)(('max', 'john'))
('|max|john|', None)
>>> IS_IN_SET(['max', 'john'], multiple=True)(('bill', 'john'))
(('bill', 'john'), 'value not allowed')
Instance Methods [hide private]
 
__init__(self, theset, labels=None, error_message='value not allowed', multiple=False, zero='', sort=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
options(self) source code
 
__call__(self, value) source code

Inherited from Validator: formatter

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, theset, labels=None, error_message='value not allowed', multiple=False, zero='', sort=False)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)