0

データベースに対して実行するweb2pyクエリを作成していますが、「設定:テーブルが選択されていません...」というエラーが表示されるため、結果が表示されません。

誰かがこれを手伝ってくれるかどうか疑問に思っていましたか?

クエリを実行するテーブルは次のとおりです。

db.define_table('Flight',
    Field('FlightNum', type = 'string', length = 10, notnull = True),
    Field('PlaneID', type = 'string', length = 10, notnull = True),
    Field('DepartureLocation', type = 'string', length = 20, notnull = True),
    Field('ArrivalLocation', type = 'string', length = 20, notnull = True),
    Field('DepartureDate', type='date'),
    Field('ArrivalDate', type='date'),
    Field('DepartureTime', type = 'time'),
    Field('ArrivalTime', type = 'time'))

私の質問は:

def displayFlights():
    tuples=db((db.Flight.DepartureLocation is request.vars.DepartureLocation)&
       (db.Flight.ArrivalLocation is request.vars.ArrivalLocation)&
       (db.Flight.DepartureDate is request.vars.DepartureDate)&
       (db.Flight.ArrivalDate is request.vars.DepartureDate)).select()
    return dict(tuples=tuples)

誰かがこのクエリを修正するのを手伝ってくれませんか?

4

1 に答える 1

0

==クエリは、ではなく、で構成する必要がありますis

db.Flight.DepartureLocation == request.vars.DepartureLocation
于 2013-01-16T12:42:04.843 に答える