Hi Guys,

I am currently working on a query which is meant to search the database and 
return the flights that the users wants.. The query is as follows:

def displayFlights():
    query1 = db.Flight.DepartureDate is request.vars.DepartureDate
    query2 = db.Flight.ArrivalLocation is request.vars.ArrivalLocation
    query3 = db.Flight.DepartureDate is request.vars.DepartureDate
    query4 = db.Flight.ArrivalDate is request.vars.ArrivalDate
    
    rows = db(query1 & query2 & query3 & query4).select(db.Flight.ALL)
    return dict(rows = rows)

When go to my HTML form, and hit search button after entering all the 
fields its shows me all the flights in the database and I only want flights 
where the user selects the departure location the arrival location and the 
dept/arrival date.
I tried removing the db.Flight.ALL from the select statement but it gives 
me an error stating no table is selected... 

Can't seem to work out what's happening.. 

-- 



Reply via email to