Hi all

I'm looking for a way to validate the record data I receive from a
webservice.
Because there is no form associated it seems that I cannot use SQLFORM
and form.accepts().

Is there any other way to use the already defined validators to do the
check?

I'm searching for something like (untested):

@service.jsonrpc
def update(record):
    errors = validate(db.mytable, record)
    if errors:
        return dict(success=False, msg=', '.join(errors))
    else:
        db(db.mytable.id == record.id).update(record)
        return dict(success=True)


TIA - Marcel

Reply via email to