'Custom Form Validation:
multi-field level'

@staticmethod
def cap_alert_onvalidation(form):

    form_vars_get = form.vars.get
    if (not form_vars_get('is_template')):
        if (not form_vars_get('scope')):
            form.errors['scope'] = current.T("'Scope'    field    is    mandatory    for    actual    alerts!")
        if (form_vars_get('scope') == 'Private'):
            request = current.request
            if ((request.controller == 'cap') and (request.function == 'alert')):
                if (not form_vars_get('addresses')):
                    form.errors['addresses'] = current.T("'Recipients'    field    mandatory    in    case    of    'Private'    scope")
        if ((form_vars_get('scope') == 'Restricted') and (not form_vars_get('restriction'))):
            form.errors['restriction'] = current.T("'Restriction'    field    mandatory    in    case    of    'Restricted'    scope")
        if (form_vars_get('addresses') and (not form_vars_get('scope'))):
            form.errors['scope'] = current.T("'Scope'    field    mandatory    in    case    using    'Recipients'    field")
        if (form_vars_get('status') == 'Draft'):
            form.errors['status'] = current.T("Cannot    issue    'Draft'    alerts!")
