In the controller I have the code:

    form = SQLFORM(db.plugin)

    #sets a non-editable form value to an editable form value. There
is then a DB validator which converts it into a proper slug
    form.vars.slug = form.vars.name

    if form.accepts(request.vars, session):

My problem is that I want to alter data that has been submitted by the
form before it is saved into the database. If I do what I have done
above, then it errors out if the form hasn't been submitted.  I
understand that form.accepts() essentially checks if the form has been
submitted, then validates the data and then saves the data, all
without being interrupted. Coming from Django I'm used to:

    if the form has been submitted:
        if the form is valid:
            save the form()

Which leaves many stages at which to validate data. Has anyone come
across this problem before? What were your solutions?

Thanks alot.
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to