I would like to find out how to achieve this comparison:
row = db(db.mytable.start_date < today < db.mytable.end_date).select()
I am getting this error:
Traceback (most recent call last):
File
"/Users/teddyl/PycharmProjects/website/web2py/gluon/contrib/shell.py", line
234, in run
exec comp
Try
query = db.mytable.start_date < today & db.mytable.end_date > today
row = db(query).select()
This works for me:
surveylist = [(x.id, x.name) for x in db(
(db.survey.startdate <= today)&
(db.survey.enddate >= today)).select(db.survey.id,
2 matches
Mail list logo