'Helper to run the onvalidation routine for a record
@param table: the Table
@param record: the FORM or the Row to validate
@param method: the method'

@classmethod
def onaccept(cls, table, record, method='create'):

    if hasattr(table, '_tablename'):
        tablename = table._tablename
    else:
        tablename = table
    onaccept = cls.get_config(tablename, ('%s_onaccept' % method), cls.get_config(tablename, 'onaccept'))
    if ('vars' not in record):
        record = Storage(vars=Storage(record), errors=Storage())
    if onaccept:
        callback(onaccept, record, tablename=tablename)
    return
