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
----------------------------------------------
Time
   --> Account
   --> Job
Job --> Account

I am trying to pull back a few rows from Time, Job and Account via the
orm library.  I want to try and avoid using the actual sql objects.

I can't join them simply like below because the reference between Job
and Account is making the join ambiguous.  I want to join Time to Job
and Time to Account.

q = orm.query(
      func.sum(Time.hours),
      Time.day,
      Job.number,
      Account.code
     )
q = q.join(Job)
q = q.join(Account)

How can i tell sqlalchemy to join Job and Account to Time, and not to
eachother?

Bryan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to