[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 create an

[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 grosbe...@gmail.com wrote: Hi, i have search posts on this group, but i don't have found the solution of my

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
),queries)* *db(query).select()* On Fri, Feb 10, 2012 at 8:10 PM, gbs grosbe...@gmail.com wrote: 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

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
rochacbr...@gmail.com 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:(ab),queries)* *db(query).select()* On Fri, Feb 10, 2012 at 8:10 PM, gbs grosbe

[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 grosbe...@gmail.com wrote: Thanks to all. I have test the first answer, from Bruno

[web2py] Re: Chain/Multiple condition on select

2012-02-10 Thread gbs
day! On 11 fév, 00:23, Anthony abasta...@gmail.com 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' object has no attribute 'select', etc ;) Once the query has