'It is not valid to re-import a template that already has a
status of Active or higher'

@staticmethod
def template_onvalidate(form):

    template_id = form.vars.id
    table = current.s3db.survey_template
    row = current.db((table.id == template_id)).select(table.status, limitby=(0, 1)).first()
    if ((row is not None) and (row.status > 1)):
        return False
    return True
