controllers / default.py

def check(form):
    if form.vars.b and not form.vars.c:
        form.errors.c = 'If the b is checked, c must be filled'

def action():
    form = SQLFORM(db.foo)
if form.process(onvalidation=check).accepted:
    response.flash = 'success'
return dict(form=form)
Пользовательские валидаторы Web2py