On 05/25/2016 08:36 PM, Mike Bayer wrote:
You need to be using join() and not joinedload() here. You shouldn't care about the columns or syntaxes that joinedload() renders. Search the docs for "the zen of eager loading",
Yes, I know that, but with join() my question still relevant. What I want to do is for given column name and an arbitrary SA query - retrieve unambiguous reference to the actual column of that query with priority to those columns, which are "closer" to the root SELECT.

So for SELECT foo.name, bar.name FROM foo LEFT JOIN bar ON ... and column name "name", I would like to build a function, that would return a reference to a column object for foo.name.

I found a way of doing this, using froms attribute and finding original SELECT by walking down relations, listed in it. But I wonder if there are better ways.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to