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

Class IS_DATETIME_IN_RANGE

source code

object --+        
         |        
 Validator --+    
             |    
   IS_DATETIME --+
                 |
                IS_DATETIME_IN_RANGE

example:
   >>> v = IS_DATETIME_IN_RANGE(                minimum=datetime.datetime(2008,1,1,12,20),                 maximum=datetime.datetime(2009,12,31,12,20),                 format="%m/%d/%Y %H:%M",error_message="oops")
   >>> v('03/03/2008 12:40')
   (datetime.datetime(2008, 3, 3, 12, 40), None)

   >>> v('03/03/2010 10:34')
   (datetime.datetime(2010, 3, 3, 10, 34), 'oops')

   >>> v(datetime.datetime(2008,3,3,0,0))
   (datetime.datetime(2008, 3, 3, 0, 0), None)

   >>> v(datetime.datetime(2010,3,3,0,0))
   (datetime.datetime(2010, 3, 3, 0, 0), 'oops')


Instance Methods [hide private]
 
__init__(self, minimum=1, maximum=1, format='%Y-%m-%d %H:%M:%S', error_message=1)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, value) source code

Inherited from IS_DATETIME: formatter

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

Static Methods [hide private]

Inherited from IS_DATETIME: nice

Class Variables [hide private]

Inherited from IS_DATETIME: isodatetime

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, minimum=1, maximum=1, format='%Y-%m-%d %H:%M:%S', error_message=1)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: IS_DATETIME.__init__

__call__(self, value)
(Call operator)

source code 
Overrides: IS_DATETIME.__call__