Hello Jonathan

Yes, I was suspecting that aliased was the solution but wasn't sure if it's 
the correct approach.

It works, thank you for your help!

On Saturday, 6 January 2018 18:52:54 UTC+1, Jonathan Vanasco wrote:
>
> use `sqlalchemy.orm.aliased` to create an alias of A for your join 
> condition...
>
>     A_alt = sqlalchemy.orm.aliased(A, name='a_alt')
>
> then use that to join and specify your join conditions
>
> the `contains_eager` needs to specify the alias though. 
>
>     options(sqlalchemy.orm.contains_eager('a.c.a', alias= A_alt)
>
>  i didn't know about that last bit, and just had an issue 2 days ago in 
> this thread, which has some sample code showing how an aliased join works. 
> https://groups.google.com/forum/#!topic/sqlalchemy/VLStmyJazVM
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to