I'm doing the following: if form.accepts(request.vars,session,onvalidation=my_val): session.flash='success' redirect(URL(r=request,f='newpage')) elif form.errors: response.flash='error'
I'm wondering if the data are committed to the db before my_val gets executed or only afterwards? In other words, if my_val does a db query, will it find already in the db the data from the form? If no, what if the form acceptance depends on checking the interaction between the data already in the db and data on the form? In essence, I want to write the form data to the db, run an algo, then decide whether to rollback the db. I think I'm really close to the answer, but I'm not sure what the right way is to do this. Anyone have a simple example? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@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 -~----------~----~----~----~------~----~------~--~---