[sqlalchemy] Re: How to clarify ambiguous join

2009-03-09 Thread Michael Bayer
On Mar 9, 2009, at 5:05 PM, Bryan wrote: > > Yes, Time.emp is a relation to the Employee object. I was trying to > avoid having this query know anything about the actual table column > names, so I wanted to avoid Time.employeeId. When I say Time.emp, > howcome all of the table's columns are ad

[sqlalchemy] Re: How to clarify ambiguous join

2009-03-09 Thread Bryan
Yes, Time.emp is a relation to the Employee object. I was trying to avoid having this query know anything about the actual table column names, so I wanted to avoid Time.employeeId. When I say Time.emp, howcome all of the table's columns are added to the query output? On Mar 9, 2:02 pm, "Michael

[sqlalchemy] Re: How to clarify ambiguous join

2009-03-09 Thread Michael Bayer
Bryan wrote: > > The join works great now. Thanks. > > This query is actually being used for a subquery. Table 'Time' also > has a column 'employeeId', which translates to an orm attribute of > 'emp'. When I add Time.emp to the columns of this subquery, all > columns of the 'Time' table are out

[sqlalchemy] Re: How to clarify ambiguous join

2009-03-09 Thread Bryan
The join works great now. Thanks. This query is actually being used for a subquery. Table 'Time' also has a column 'employeeId', which translates to an orm attribute of 'emp'. When I add Time.emp to the columns of this subquery, all columns of the 'Time' table are output instead of just the 'e

[sqlalchemy] Re: How to clarify ambiguous join

2009-03-09 Thread Michael Bayer
specify the join as an "on" condition: q.join(Time.account) q.join(Time.job) Bryan wrote: > > I have a table 'Time' that has many-to-1 relationships to tables 'Job' > and 'Account'. There is also a 1-to-many relationship between job and > Account. > > Tables > --