Re: [sqlalchemy] Relationship depending on a field in join table.

2014-04-27 Thread Peder Husom
kl. 20:26:24 UTC+2 lørdag 26. april 2014 skrev Michael Bayer følgende: > > > On Apr 26, 2014, at 2:23 PM, Michael Bayer > > > wrote: > > If OTOH you do in fact want this query to take the current Company.id into > account, this would be simple using primaryjoin/secondaryjoin/secondary, it > j

Re: [sqlalchemy] Relationship depending on a field in join table.

2014-04-26 Thread Michael Bayer
On Apr 26, 2014, at 2:23 PM, Michael Bayer wrote: > If OTOH you do in fact want this query to take the current Company.id into > account, this would be simple using primaryjoin/secondaryjoin/secondary, it > just requires that the IN is unwrapped into a regular join criterion. Assume > the na

Re: [sqlalchemy] Relationship depending on a field in join table.

2014-04-26 Thread Michael Bayer
On Apr 26, 2014, at 10:59 AM, Peder Husom wrote: > Hi, I've been to the IRC channel and gotten alot of help from "inklesspen", > but I can't seem to figure this out. > > I have these tree tables; > > Users > - iduser > - name > > Companies > - idcompany > - name > > CompaniesUsers > -

[sqlalchemy] Relationship depending on a field in join table.

2014-04-26 Thread Peder Husom
Hi, I've been to the IRC channel and gotten alot of help from "inklesspen", but I can't seem to figure this out. I have these tree tables; Users - iduser - name Companies - idcompany - name CompaniesUsers - companyid - userid - owner (TINYINT|Boolean) Now in my "Company" class I want