In order to get a query object you have to use the field objects and
not string representations of them, so you can not do
"(db.%s.%s.contains('%s'))" %(filname, term, request.vars[term]))
that should be
db[filname][term].contains(request.vars[term])
and since queries can be ANDed together, you
Should be
querylist = []
for term in request.vars:
if term != 'n':
querylist.append(db[filename]
[term]contains(request.vars[term]))
queryterm = reduce(lambda a,b:a&b, querylist)
search = db(queryterm).select()
queries should not be strings but objects. It works
2 matches
Mail list logo