On 8/17/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> hi Vetle -
>
> the Table object supports a join() method, which can be called in a
> chain, i.e.
>
> table1.join(table2).join(table3)...
>
>
> if you need to specify the "ON" part of the join, its the second
> argument to join() (below illustrated with two joins back to table1):
>
> table1.join(table2, table1.c.id==table2.c.someid).join(table3,
> table1.c.id==table3.c.id)
>
>
> hope this helps...

Yes thanks, it helped a little bit. I realized I could to this inside
from_obj = [ ... ]. That, in addition to using table aliases.

I ended up with something like:
t1_2 = t1.alias('t1_2')
select([t1, t1.c.a .... ],
    from_obj = [t1.join(t1_2, t1.c.a = t1_2.c.b).join(.....)]

It was kinda complicated, and the schema could have been designed a
little differently, but I got it working at last. ;)

-- 
Vetle Roeim

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to