instead of using the above I went with the code below, if anyone comes across this problem queries=[] if arg1 == "xyz": queries.append(db.abc.id > 0) if arg2 == "abc": queries.append(db.abc.age > 5) query = reduce(lambda a,b:(a&b),queries)
and you can insert this query into SQLFORM.grid(query) On Saturday, July 28, 2012 11:07:33 PM UTC-7, dave wrote: > > I have something like > qset=db() > if arg1 == "xyz": qset=qset(db.abc.id > 0) > if arg2 == "abc": qset=qset(db.abc.age > 5) > x = qset.select() > > > now I want to pass x to SQLFORM.grid something like this > return SQLFORM.grid(x) > but this does not work because qset.select returns all the rows with all > the columns I think, I know that SQLFORM.grid accepts a table or a query so > how can I pass x to it? --