Hi Anthony,

As mentioned on Stack Overflow: 

I am currently working with the FORM because this is very frustrating that 
the query isn't working properly or I can't seen to figure out how to get 
it working properly..

with the form this is the code that I am using.. this is just a prototype 
to see if the form even works.. however i get an error stating, unexpected 
indent.. I've corrected the spacing and i still keep getting the same 
error.. i've tried the line on every space after and still get the same 
error.

def display():
    form=FORM(TABLE(TR("Departure Location: ", INPUT(_type="text", 
_name="DepartureLocation", IS_IN_SET(states))))),
        TR("Arrival Location: ", INPUT(_type="text", 
_name="ArrivalLocation", IS_IN_SET(states))),
        TR("", INPUT(_type="submit", _value="Submit"))
        
    if form.accepts(request.vars, session):
        ##check to see if flight present in the database.
        if 
len(db(db.Flight.DepartureLocation==form.vars.DepartureLocation).select()==0:
            form.errors.DepartureLocation="No flights available"
        
        if len(form.errors)==0:
            
flight=db((db.Flight.DepartureLocation==form.vars.DepartureLocation)&
                      
(db.Flight.ArrivalLocation==form.vars.ArrivalLocation)).select()
     
    records=db(flight).select(db.Flight.DepartureLocation, 
db.Flight.ArrivalLocation, db.Flight.DepartureDate, db.Flight.ArrivalDate)
       
    return dict(form=form records=SQLTABLE(Flight), vars=form.vars, 
vars2=request.vars)

-- 



Reply via email to