If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    viniciusban  11 years ago

    Put this validator in a module, then import and use it.

    Or put it in some models/a_my_custom_validators.py  to become global throughout your application.

     

    More on this: http://web2py.com/books/default/chapter/29/07#Custom-validators

Commented on:

IS_NOT_EMPTY_IF_OTHER validator requires filling field A if field B has content. If field B is empty, field A may be empty, too. Example: requires confirm_password if password is present. Note: "other" argument may be a list of fields. If any of them is not empty, the field must be filled

Hosting graciously provided by:
Python Anywhere