thanks again for your help. I was curious though, I don't really
understand what
select_from is doing, and why it is able to map this data. I couldn't
really find
good explanations in the documentation about this. is there a good
place for me
to look to understand what this is doing? My understanding is that it
replaces the
selectable for the query, but I don't understand why this would change
the mapping
properties of this query.

On Apr 16, 1:04 pm, Michael Bayer <[email protected]> wrote:
> the sophisticated column correlation you're looking for will only work  
> if you use query.select_from(s), in which case there's no point in  
> creating the final subquery, just call select_from(j) to prevent an  
> unnecessary layer of nesting.  It also seems like your ultimate query  
> is better expressed just as a join of three tables instead of a join  
> to a subquery.

this is true because this was a contrived example used to simplify the
query in such
a way that I could provide a (hopefully) easy to understand example
that duplicated
my problem.

>
> Otherwise, to use from_statement() you'd have to construct your select  
> statement such that the names of all columns match exactly what the  
> query would look for normally - i.e. "outside_id" for "test_table_id"  
> since you're aliasing on "outside", etc.  from_statement() is a more  
> brute force approach in that way.

this is generally what I try to do, and have gotten relatively good
at. however this particular
query with the nested aliases was failing. Do you have any advice or
tips for how to
get this to work? I got this particular example working with
select_from, but I'd still be
very interested in knowing how I could have accomplished my goal using
from_statement
with this example.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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