So my question goes as follows:
#################models/db1.py
db.define_table('Restaurant',
Field('Name',unique=True),
..................................................
.......................auth.signature,format='%(Name)s')
db.define_table('Menu',
Field('menu','upload'),
Field('restaurant','reference Restaurant',writable=False))
############controller/func()
indices=db(db.Menu).select()
for index in indices:
t=db(
index.restaurant.Name==request.args[0]).select(db.Menu.ALL).first()
if t:
record=db.Menu(
t.id)
form=SQLFORM(db.Menu,record).process()
......................................................................
.....................................................................
(I have one record in the Menu table now)
The question is that the first record gets selected even if the condition is not true.I do not understand it.Please tell me what I am doing wrong.Any help is appreciated.
Regards,
Brooks