so no, the onvalidation is meant to "reject" the submission if something in the form doesn't need to be stored in the database. But, you want it stored no matter what, and then checked to see if it's correct. This can be done hooking up to the _after_insert event on the table where you store answers
http://web2py.com/books/default/chapter/29/06?search=after_insert On Sunday, May 19, 2013 11:26:23 PM UTC+2, Chris Teodorski wrote: > > The event is tied to the submit, in this case, it's basically a "test" > question. When the correct answer is submitted by the user (based upon a > check of the database) then their row in the table is updated as having > been correct. > > > On Sunday, 19 May 2013 15:39:05 UTC-4, Niphlod wrote: >> >> it depends.... if this "event" is bound to the user pressing the submit >> on a form, maybe the best place is the onvalidation callback of the >> accepts() or process() method >> >> >> http://web2py.com/books/default/chapter/29/07?search=onvalidation#onvalidation >> >> On Sunday, May 19, 2013 8:37:32 PM UTC+2, Chris Teodorski wrote: >>> >>> I have a form, that users submit -- when they submit the form, I want to >>> validate it against valid data in the database, but I'm not sure where that >>> query belongs. I was trying to put it in a controller but it's not working >>> like I expected. Where is the right place to put these database calls, >>> both queries and updates? >>> >>> Thanks for the help. >>> >>> Chris >>> >>> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

