• 773 views
  • 0 comments
  • loading...

form.accepts()

All the work is done by the accepts method of the form object. It filters the request.vars according to the declared requirements (expressed by validators). accepts stores those variables that pass validation into form.vars. 

The accepts function returns True if the form is accepted and False otherwise. A form is not accepted if it has errors or when it has not been submitted (for example, the first time it is shown).



form.accepts(vars, session=None, formname='default',

keepvalues=False, onvalidation=None,
dbio=True, hideerror=False):

Attributes / Arguments

The first argument can be request.vars or request.get_vars or request.post_vars or simply request. The latter is equivalent to accepting as input the request.post_vars.

session session=None

formname formname='default'

keepvalues keepvalues=False

onvalidation onvalidation=None

dbio dbio=True

hideerror hideerror=False


loading...

Sources / Reference

" web2py Book Chapter 7: Forms and Validatators" is licensed under Creative Common License BY-NC-ND 3.0


Comments

loading...

Powered by
Web2py

Hosted on
www.pythonanywhere.com
(affiliated link)