process() calls validate(), and validate() calls accepts(), so they all do 
mostly the same thing. They all take a dbio argument, which determines 
whether to update the db in the case of SQLFORM. dbio defaults to True in 
process() and accepts() and False in validate(), so yes, by default, 
form.validate() will not update the db -- though form.validate(dbio=True)will 
update the db.

If you want validation without dbio, you can do form.validate() or 
form.process(dbio=False).accepted -- both of those are equivalent and will 
return a True|False value indicating the outcome.

Anthony

On Monday, November 7, 2011 8:10:30 AM UTC-5, viniciusban wrote:
>
> Anthony, and if I just want the form validation, without updating the 
> database?
>
> Isn't what form.validate().accepted is supposed to do?
>
> On Mon, Nov 7, 2011 at 11:01 AM, Anthony <abas...@gmail.com> wrote:
> > Yes, that's an error in the book. form.validate() returns True or False.
> > form.process() returns the form itself, so you have to check the status 
> via
> > form.process().accepted.
> > Anthony
> >
> > On Monday, November 7, 2011 7:15:54 AM UTC-5, viniciusban wrote:
> >>
> >> I tryed this construction:
> >> if form.validate().accepted:
> >>    print "accepted"
> >>
> >> But I got this error:
> >> AttributeError: 'NoneType' object has no attribute 'accepted'
> >>
> >> In book, chapter 7, "SQLFORM without database IO" section has 2
> >> examples using form.validate().accepted.
> >> Is it an error or didn't I get something?
> >>
> >> --
> >> Vinicius Assef.
> >
>
>

Reply via email to