Re: [sqlalchemy] Many-to-many using custom join columns and autoloaded tables

2020-07-22 Thread Rob Rosenfeld
Thanks. Sorry I missed that. I latched onto "*Joins to a Target Entity or Selectable*" On Tue, Jul 21, 2020 at 11:15 PM Mike Bayer wrote: > to join on the relationships you have to name them: > > > Class.query.join(Class.enrollments).join(Enrollment.students).join(Student.details) > > the diff

Re: [sqlalchemy] Many-to-many using custom join columns and autoloaded tables

2020-07-21 Thread Mike Bayer
to join on the relationships you have to name them: Class.query.join(Class.enrollments).join(Enrollment.students).join(Student.details) the different ways to join are laid out at https://docs.sqlalchemy.org/en/13/orm/query.html?highlight=query%20join#sqlalchemy.orm.query.Query.join On Tue, Ju

[sqlalchemy] Many-to-many using custom join columns and autoloaded tables

2020-07-21 Thread Rob Rosenfeld
Hi All, I'm struggling to put several concepts together. I am working with a legacy SQL Server database (2008 R2 and 2019) that was not setup with much planning, let alone ORM in mind. I would like to set up a many to many relationship that joins through columns I specify and all the tables ar