[web2py] Chain/Multiple condition on select

2012-02-10 Thread gbs
Hi, i have search posts on this group, but i don't have found the solution of my question :$ I have a table, wich display record of a database, nothing weird.. I have made a form, so you can "filter" the result. You can check "Tag" of the record, "Status" of the record, so on... How can i crea

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
I know that you can do : result = db((db.xxx.tag==tag) & (db.xxx.status==status)).select() But i don't know how to generate the condition, one by one... On 10 fév, 23:10, gbs wrote: > Hi, > > i have search posts on this group, but i don't have found the solution &g

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
ere* > > *query = reduce(lambda a,b:(a&b),queries)* > > *db(query).select()* > > On Fri, Feb 10, 2012 at 8:10 PM, gbs wrote: > > Hi, > > > i have search posts on this group, but i don't have found the solution > > of my question :$ > > > I

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
runo Rocha wrote: > > *queries=[]* > > *if arg1 == "x": queries.append(db.table.field == x)* > > *if arg2 == "y": queries.append(db.table.otherfield == y)* > > *# many conditions here* > > *query = reduce(lambda a,b:(a&b),queries)* > >

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
I have try the solution of anthony, but i don't have the skill in python to success.. (some error with 'Rows' object has no attribute 'select', etc ;) But it's my fault, Thanks again On 10 fév, 23:43, gbs wrote: > Thanks to all. > > I have test the f

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
ope that can help someone else, Have a nice day! On 11 fév, 00:23, Anthony wrote: > On Friday, February 10, 2012 6:19:09 PM UTC-5, gbs wrote: > > > I have try the solution of anthony, but i don't have the skill in > > python to success.. > > (some error with 'Rows&#x