On Sep 16, 2011, at 5:28 AM, Adrian wrote:

> I have seen that it is possible to get an entity from a subquery with the 
> aliased(entity,statement) construct. Is there also a way to get more than one 
> entity from a subquery, for example 2?

You can of course have a subquery that represents multiple entities internally, 
and then the subquery itself has a .c. attribute which you can use to construct 
further statements in terms of the columns of the entity.   Otherwise it seems 
like you'd be asking for myalias.Entity1.foo, myalias.Entity2.bar ?   If that's 
what you mean, I think for the moment you'd need to stick with a pattern like 
myalias.c.entity1_foo, myalias.c.entity2_bar, where "myalias" is a Core "Alias" 
construct, rather than an ORM alias.

Feel free to send an example of what you're looking for if more info is needed.


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