[sqlalchemy] Inheritance and self.reference

2015-11-19 Thread Bernhard Radermacher
I am stumped... I have the following scenario: Two classes (Project and Package) inherit from class Container. Project is at the top-level of the hierarchy, and can contain Packages, Package must be contained in a Project or a different Package (i.e. a Container) and can contain other

Re: [sqlalchemy] Inheritance and self.reference

2015-11-19 Thread Mike Bayer
On 11/19/2015 02:38 PM, Bernhard Radermacher wrote: > I am stumped... > > I have the following scenario: Two classes (Project and Package) inherit > from class Container. Project is at the top-level of the hierarchy, and > can contain Packages, Package must be contained in a Project or a >

Re: [sqlalchemy] Inheritance and self.reference

2015-11-19 Thread Bernhard Radermacher
That works great, thanks. If I understand correctly, the inherit_condition is deduced automatically, when there is no other foreign key linking to the super-class... On Thursday, November 19, 2015 at 12:52:33 PM UTC-8, Michael Bayer wrote: > > > > the docs are slight here but the format is