Thanks. IS_EMPTY_OR() will do just fine.
On Nov 15, 2:08 pm, Richard Vézina <ml.richard.vez...@gmail.com> wrote: > IS_EMPTY_ORhttp://web2py.com/book/default/chapter/07IS_EMPTY_OR > Search for IS_EMPTY_OR in this page : > > http://web2py.com/book/default/chapter/07 > > I think : > > requires = IS_EMPTY_OR > <http://web2py.com/book/default/docstring/IS_EMPTY_OR>(IS_DATE > <http://web2py.com/book/default/docstring/IS_DATE>()) > > Do what you want.. > > Richard > > > > > > > > On Tue, Nov 15, 2011 at 2:03 PM, Jay <jkel...@gmail.com> wrote: > > In my app some input fields are optional. As an example, currently > > IS_DATE() forces the date to be present. I was wondering if it makes > > sense to allow Null or '' (empty) dates and then use IS_NOT_EMPTY() to > > force a value to be present in that field. > > > In general, does it appeal to web2py users to use this approach? Can > > we change validators to allow this? I am happy to supply patches for > > all affected validators, if it is agreeable. It would certainly be > > more flexible. > > > For now I have been writing a changed copy of the needed validators in > > my db.py file. Is there a better way to do it?