Hi niknok I have recently been editing the book (prompted by the suggestions of Kevin Ivarsen). You may find that these issues have been resolved. Please take a look (at the online version) and let me know if this section is still not correct.
http://web2py.com/book/default/chapter/07#Validators Many thanks, David On Mar 18, 12:02 am, niknok <nikolai...@gmail.com> wrote: > In Validator section of Chapter 7, the example for IS_DATE_IN_RANGE > incorrectly uses IS_DATETIME where IS_DATE_IN_RANGE is expected: > > requires = IS_DATE(format=T('%Y-%m-%d'), > minimum=datetime.date(2008,1,1), > maximum=datetime.date(2009,12,31), > error_message=T('must be YYYY-MM-DD!')) > > should be: > > requires = IS_DATE_IN_RANGE(format=T('%Y-%m-%d'), > minimum=datetime.date(2008,1,1), > maximum=datetime.date(2009,12,31), > error_message=T('must be YYYY-MM-DD!')) > > The same error occured in the IS_DATETIME_IN_RANGE validator example: > > requires = IS_DATE(format=T('%Y-%m-%d'), > minimum=datetime.date(2008,1,1), > maximum=datetime.date(2009,12,31), > error_message=T('must be YYYY-MM-DD!')) > > should read as: > > requires = IS_DATETIME_IN_RANGE(format=T('%Y-%m-%d'), > minimum=datetime.date(2008,1,1), > maximum=datetime.date(2009,12,31), > error_message=T('must be YYYY-MM-DD!')) > > hth