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

Class IS_DATE_IN_RANGE

source code

object --+        
         |        
 Validator --+    
             |    
       IS_DATE --+
                 |
                IS_DATE_IN_RANGE

example:

   >>> v = IS_DATE_IN_RANGE(minimum=datetime.date(2008,1,1),                                  maximum=datetime.date(2009,12,31),                                  format="%m/%d/%Y",error_message="Oops")

   >>> v('03/03/2008')
   (datetime.date(2008, 3, 3), None)

   >>> v('03/03/2010')
   ('03/03/2010', 'oops')

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

   >>> v(datetime.date(2010,3,3))
   (datetime.date(2010, 3, 3), 'oops')
Instance Methods [hide private]
 
__init__(self, minimum=None, maximum=None, format='%Y-%m-%d', 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_DATE: formatter

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, minimum=None, maximum=None, format='%Y-%m-%d', 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__