[web2py] conditional update after form is submitted

2012-11-10 Thread Simon Carr
Hi, I want to run some code after an update form is submitted but before the record in the database is updated. Where can I put the code so that I know the values in the form have passed validation before I run my code. Thanks Simon --

Re: [web2py] conditional update after form is submitted

2012-11-10 Thread Niphlod
or use the onvalidation callback on form.process form.process(onvalidation=yourfunction).accepted On Saturday, November 10, 2012 6:57:10 PM UTC+1, Vasile Ermicioi wrote: if form.validate(request.vars): #your code form.accepts(request.vars) --

Re: [web2py] conditional update after form is submitted

2012-11-10 Thread Simon Carr
Hi Vasile, Thanks for the reply, but that code seems to generate an error if form.validate(request.vars): TypeError: validate() takes exactly 1 argument (2 given) Here is my full function that I am trying to run if it helps @auth.requires_login() def edit_chart(): record =

Re: [web2py] conditional update after form is submitted

2012-11-10 Thread Simon Carr
Thanks Batman, That is what I was looking for. I thought I had seen it before, but could not find it again when searching the documentation. Cheers Simon On Saturday, 10 November 2012 19:47:00 UTC, Niphlod wrote: or use the onvalidation callback on form.process