SQLAlchemy: Many-to-Many dynamic loading on both sides
问题 Let's say I have the following: association_table = Table('things_stuffs', Base.metadata, autoload=True, extend_existing=True) class Thing(Base): __tablename__ = 'things' __table_args__ = {'autoload': True} class Stuff(Base): __tablename__ = 'stuffs' __table_args__ = ( {'autoload': True} ) things = relationship(Thing, secondary=association_table, backref=backref("stuffs", uselist=False, lazy='dynamic')) Now, if I want to get all the things from a Stuff instance I can do: a_stuff_instance