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
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