On Thursday, January 4, 2018 at 10:58:49 AM UTC-5, Mike Bayer wrote: > > that and, when you use contains_eager you need to tell it what entity > it's looking for when it considers columns as part of a relationship: > > .options(sqlalchemy.orm.contains_eager('foo_alt', alias=Foo_2))\ >
As always, THANK YOU SO MUCH, MIKE. That alias kwarg was the missing bit. The `foreign` was left over from the original query and wasn't removed by accident (the original doesn't fkey on a primary for the join). -- 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.