Also, I am querying a local database that I created using the DAL. Yes, I am creating a custom HTML form and posting it to web2py to query the database..
On Sunday, January 13, 2013 9:45:11 AM UTC+10:30, Anthony wrote: > > Can you provide more details regarding what you have tried? How are you > creating the form and posting to web2py? Are you querying local databases > that you are modeling with the DAL, or are you querying some external API's? > > When you submit a form to web2py (via GET or POST), the variables will be > available in request.vars (also in request.get_vars if a GET request and > request.post_vars if a POST request). If you create the form via a web2py > FORM or SQLFORM, then once the form has been processed, the values will > also be in form.vars. From there it's up to you to use the values to > construct your query. > > Anthony > > On Saturday, January 12, 2013 6:10:05 PM UTC-5, Mihir Lade wrote: >> >> Hi Alan, >> >> I've read the chapters a few times however having difficulty >> understanding a HTML search page would pass the information to a function >> where it queries multiple databases to return the data? >> >> On Sunday, January 13, 2013 8:14:07 AM UTC+10:30, Alan Etkin wrote: >>> >>> The book has anything you are asking for and much more. For an >>> introduction to forms and controllers I think you could check the examples >>> at Overview: >>> >>> http://www.web2py.com/books/default/chapter/29/03#Overview >>> >>> Also, there are appliances available you can use as example: >>> >>> http://www.web2py.com/appliances >>> >>> Once you have learned using the basic API you can check for more >>> examples at: >>> >>> http://www.web2pyslices.com >>> >>> >>> El sábado, 12 de enero de 2013 07:13:11 UTC-3, Mihir Lade escribió: >>>> >>>> Hi Guys, >>>> >>>> I am currently working on an assignment where I need to create a >>>> function which would query the database to search flights available >>>> according to the users input through the HTML form. I have attached a >>>> picture of the HTML form. >>>> >>>> Basically the user, selects the origin, the destination, oneway/return, >>>> departure date, arrival date, etc etc and than clicks submit. >>>> >>>> This should than return all the flights available in a different page, >>>> however I am having difficulty actually writing the function that will >>>> query the database to do this. >>>> >>>> I am not sure how the HTML form would pass the values to the >>>> searchFlights() function and what the function may look like.. >>>> >>>> Can some one please assist me with this? Any help with this would be >>>> REALLY appreciated. >>>> >>>> Thank you in advanced. >>>> >>> --

