[web2py] Re: Querying rows over several many-to-many tables.

2014-01-30 Thread Massimo Di Pierro
No difference. On Wednesday, 29 January 2014 18:12:07 UTC-6, Apple Mason wrote: > > Can you quickly explain the difference between: > > (db.clothing.id==db.clothing_person.clothing_Id) & > (db.person.id==db.clothing_person.person_id) > > and > > (db.clothing_person.clothing_id==db.clothing.id) &

[web2py] Re: Querying rows over several many-to-many tables.

2014-01-29 Thread Apple Mason
Can you quickly explain the difference between: (db.clothing.id==db.clothing_person.clothing_Id) & (db.person.id==db.clothing_person.person_id) and (db.clothing_person.clothing_id==db.clothing.id) & (db.clothing_person.person_id==db.person.id) On Wednesday, January 29, 2014 5:15:51 PM UTC-5,

[web2py] Re: Querying rows over several many-to-many tables.

2014-01-29 Thread Niphlod
You can't achieve it without a "custom function", but it's not that hard to write //totally untested// def search_whatever(people=[], items=[], clothings=[]): q = db.people.name.belongs(people) if items: q = q & (db.item_person.person_id == db.person.id) #the reference

[web2py] Re: Querying rows over several many-to-many tables.

2014-01-29 Thread Apple Mason
Is there a more lenient version of what_I_want that will give me based on what I put in? For example, If I just want all people named Bob, it would return all people named Bob. If I just want all people named Bob or nicknamed Bobcat, then I wlll get all people named Bob or nicknamed Bobcat. If

[web2py] Re: Querying rows over several many-to-many tables.

2014-01-29 Thread Niphlod
why the hassle of using joins like those ones ? If you're not fond of searching through left joins, and you still want your whole dataset "consistent", and a search "a-la-fulltext".better do something like this whole_set = ( (db.person.id == db.clothing_person.person_id) & (db.clot