Re: [sqlalchemy] One-to-many relationship between two subclasses with foreign key in parent classes

2019-03-24 Thread Jan Dalheimer
I guess the simplest solutions are often the best… Turns out this actually works flawlessly (from what I’ve been able to tell so far), I didn’t expect SQLAlchemy to be smart enough to figure it out so I never even tried it this simple… Thanks! > On 23 Mar 2019, at 20:04, Mike Bayer wrote: >

Re: [sqlalchemy] One-to-many relationship between two subclasses with foreign key in parent classes

2019-03-23 Thread Mike Bayer
On Sat, Mar 23, 2019 at 12:39 PM 02JanDal wrote: > > Hello, > > I have two simple inheritance trees using joined table inheritance, see code > below. In short, MembershipType inherits BaseShopItem and Membership inherits > TransactionItem and there is a one-to-many relationship between

[sqlalchemy] One-to-many relationship between two subclasses with foreign key in parent classes

2019-03-23 Thread 02JanDal
Hello, I have two simple inheritance trees using joined table inheritance, see code below. In short, MembershipType inherits BaseShopItem and Membership inherits TransactionItem and there is a one-to-many relationship between BaseShopItem and TransactionItem. This works well, but now I want