obviously if the there is no data form.accepts() returns false. if form.accepts() #returns true<if form validates> or false<if no post vars or form validation has errors ... elif form.errors: # there were errors
-Thadeus On Tue, Jan 5, 2010 at 10:14 PM, Christopher Helck <christopher.he...@gmail.com> wrote: > I can not understand form.accepts(). I think it's because my intuitive > understanding of web2py is wrong. Here's how I think it works: > > A simple controller function ( index() say) can return a string in which > case web2py will simply serve it up as a web page. > The same function can return a dictionary, in whcih case web2py takes the > dictionary, finds a corresponding view file, merges them together using > token replacement and serves the resulting string as a web page. > > So, when I see a controller method looking something like: > > def show(): > form = SQLFORM(...) > if form.accepts(request.vars, session): > ... > > I'm reading it as: create a form, and if the user's input (request.vars) is > valid then process the input. My problem is that the form has not been > served up to the user, so how can we have the user's input? > > Obviously I am confused. Any help would be appreciated. > > Regards, > C. Helck > > > -- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to web...@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. > >
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@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.