Michael Bayer wrote:
>
> On Sep 11, 2006, at 6:37 PM, Eric Brunson wrote:
>
>>
>> I want a list of columns that I can use in a query. I was thinking
>> SA may already have a function that would build a column clause with
>> foreign key references in it and maybe even generate the list of
>> tables and join/where clause.
>
> you can do str(table1.join(table2).join(table3).select())
Michael,
Thanks for the help. In case it helps someone in the future, here's the
final incantation for what I needed:
t = sa.Table( 'ip_entity', db, autoload=True )
s = t.alias( 'parent' )
c = sa.select( [ t.c.id, t.c.name, s.c.name.label( 'parent entity' ) ],
from_obj = [ sa.outerjoin( t, s, t.c.parent_id == s.c.id ) ],
order_by = [ t.c.id ] ).execute()
Thanks again,
e.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users