Re: [sqlalchemy] Handling "generic" relations

2016-10-20 Thread Simon King
On Thu, Oct 20, 2016 at 12:11 PM, Lele Gaifax wrote: > Hi all, > > I'd like to have an Entity able to be "attached" to N different others, > avoiding the need of N intermediate/secondary tables. > > I imagine something like the following:: > > class Address(Base): >

[sqlalchemy] Handling "generic" relations

2016-10-20 Thread Lele Gaifax
Hi all, I'd like to have an Entity able to be "attached" to N different others, avoiding the need of N intermediate/secondary tables. I imagine something like the following:: class Address(Base): __tablename__ = 'addresses' id = Column(Integer, primary_key=True)