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')
   ('03/03/2010 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=None, maximum=None, format='%Y-%m-%d %H:%M:%S', error_message=None, timezone=None)
timezome must be None or a pytz.timezone("America/Chicago") object
source code
 
__call__(self, value) source code

Inherited from IS_DATETIME: formatter

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

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=None, maximum=None, format='%Y-%m-%d %H:%M:%S', error_message=None, timezone=None)
(Constructor)

source code 

timezome must be None or a pytz.timezone("America/Chicago") object

Overrides: object.__init__
(inherited documentation)

__call__(self, value)
(Call operator)

source code 
Overrides: Validator.__call__