I am currently working on a page where a user would select all the appropriate fields in a search form (html) which would than pass the values to the web2py query.
I am having an issue with writing this query? I am wondering how to actually pass the values from HTML form to the web2py query to be run against the database?
When you submit a form to web2py (via GET or POST), all the form variables will be available in
request.vars
(for more on this, see the book sections on Dispatching and therequest
object as well as the chapter on forms).So, you could do something like:
Note, the
reduce()
with the generator expression is equivalent to writing a query like this: