'Custom Form Validation'

@staticmethod
def cap_warning_priority_onvalidation(form):

    form_vars = form.vars
    table = current.s3db.cap_warning_priority
    query = (((((table.event_type_id == form_vars.event_type_id) & (table.urgency == form_vars.urgency)) & (table.severity == form_vars.severity)) & (table.certainty == form_vars.certainty)) & (table.deleted != True))
    row = current.db(query).select(table.id, limitby=(0, 1)).first()
    if row:
        form.errors['event_type_id'] = current.T("This    combination    of    the    'Event    Type',    'Urgency',    'Certainty'    and    'Severity'    is    already    available    in    database.")
