On Monday, April 25, 2011 8:47:17 PM UTC-4, JoshC wrote:
>
> What I need to know is how to get information from the view to the
> controllers and database. I wasn't able to figure out how to use this
> for instance:
>
> URL('a', 'c', 'f', args=['x', 'y'], vars=dict(z='t'))
>
> How do you access what is saved in the dict from the view on the
> controller side?
See http://web2py.com/book/default/chapter/04#Dispatching. The arguments
from the URL are stored in request.args as a list, and the variables from
the URL are stored in request.vars as a dict (technically a Storage object,
which acts like a dict) -- there's also request.get_vars and
request.post_vars to differentiate between GET and POST variables. The
request object is available in all model, controller, and view files.
Anthony