Re: [sqlalchemy] Re: Unexpected Behavior for ondelete='CASCADE' in Postgres

2010-12-10 Thread Michael Bayer
you probably want to use passive_deletes=True as well so that collections aren't loaded in for unnecessary, individual DELETEs: http://www.sqlalchemy.org/docs/orm/collections.html#using-passive-deletes On Dec 10, 2010, at 7:27 PM, Matin Tamizi wrote: > Note to self: read docs better. > > I had

[sqlalchemy] Re: Unexpected Behavior for ondelete='CASCADE' in Postgres

2010-12-10 Thread Matin Tamizi
Note to self: read docs better. I had to add a cascade='delete' in the backref. I tried this the first time, but put it in the relationship instead of the backref. class Post(Base): __tablename__ = 'posts' id = Column(Integer, primary_key=True) title = Column(String(255), nullable=False) body = C