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")
[image: http://itjp.net.br] <http://itjp.net.br> http://itjp.net.b <http://itjp.net.br>r *Ovidio Marinho Falcao Neto* ovidio...@gmail.com Diretoria de Desenvolvimento João Pessoa- Paraiba Brasil Fone: +55(83) 8826-9088 2015-02-17 20:15 GMT-03:00 Francisco Costa <m...@franciscocosta.com>: > 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 web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.