Is it possible to have a validator for dates in define_tables to end_date 
be bigger than start_date?

db.define_table(
    'events',
    Field('id', required=True, unique=True),
    Field('name', 'string', required=True),
    Field('start_date', 'date', required=True),
    Field('end_date', 'date', required=False),
)
db.events.start_date.requires = IS_DATE(format=T('%Y-%m-%d'), error_message=
T('enter date as %(format)s'))
db.events.end_date.requires = IS_EMPTY_OR(IS_DATE_IN_RANGE(format=T(
'%Y-%m-%d'), minimum=*??????*, maximum=None, error_message=T('enter date as 
%(format)s')))


How do you define the *minimum* to be bigger than the start_date?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to