Re: [sqlalchemy] composite secondary join variant

2020-04-24 Thread Jonathan Vanasco
Thanks! That works exactly as I needed. I knew there was a problem in the secondaryjoin, so i commented it out. This works more intuitively than my other composite relationships, which are all more complex. The joining you used is: primaryjoin: A->B secondaryjoin: B->B2C secondary: B2C->C --

[sqlalchemy] Re: Consolidate multiple one-to-one into a list

2020-04-24 Thread Jonathan Vanasco
On Friday, April 24, 2020 at 1:16:10 PM UTC-4, Jens Troeger wrote: > > > If I understand you correctly, then the solution above is as good as it > gets and SQLA doesn’t provide a builtin solution for what I’m trying to do? > There are so many hooks in SqlAlchemy, there may still be a more

[sqlalchemy] Re: Consolidate multiple one-to-one into a list

2020-04-24 Thread Jens Troeger
Thanks Jonathan! Yes, all classes derive from the declarative base: from sqlalchemy.ext.declarative import declarative_base Base = declarative_base(metadata=MetaData(naming_convention={...})) class Parent(Base): ... class Child(Base): ... If I understand you correctly, then the

Re: [sqlalchemy] composite secondary join variant

2020-04-24 Thread Elmer de Looff
Hi Jonathan, >From toying with it a little bit, it looks like you *need* to specify a secondaryjoin when you specify the secondary table. In your example, the secondary does some of the work that the secondaryjoin would need to do. I've created a gist that mirrors your table setup (with some more