Julien Cigar wrote:
> In fact what I want to be able to do is :
>
> select a.id, (select b.name from invasive_names b, languages c where
> b.invasive_id=a.id and b.language_id=c.id and c.iso_code='en') as
> name_en from invasives a order by foo;
>
> where mappers are : a = Invasive, b = InvasiveName, c = Language
>

right...since you are redefining the list of columns that youd like to
create instances from, in other words youd like to get the a.name_en
column out of a different table than the "invasive" table, you would
have to either use the instances() method off of a
session.query(Invasive), or make a new mapper that maps to that query
specifically.

otherwise, if you just want to put a large series of joins in a
query.select(), instead of using join_to()/join_via() you can just
create the joins yourself (such as
invasives.join(invasive_names).outerjoin(language) or whatever) and
send it to query.select() using the from_obj=[myjoin] parameter.


--~--~---------~--~----~------------~-------~--~----~
 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