• 2251 views
  • 0 comments
  • loading...

not properly a validator

This is not properly a validator. Its intended use is to allow validations of fields that return multiple values. It is used in those rare cases when a form contains multiple fields with the same name or a multiple selection box. Its only argument is another validator, and all it does is to apply the other validator to each element of the list. 
It never returns an error and does not contain an error message. The inner validator controls the error generation.



# The following expression checks that every item in a list is an integer in the range 0-10:


requires = IS_LIST_OF(IS_INT_IN_RANGE(0, 10))

loading...

Sources / Reference

" Web2py Book"


Comments

loading...

Powered by
Web2py

Hosted on
www.pythonanywhere.com
(affiliated link)