[sqlalchemy] Correct way to delete Association Objects

2011-08-24 Thread Benjamin Sims
I have a many-to-many relationship with attributes: Parent - AssocObject - Child I'm trying to set it up so that when an AssocObject is removed from parent, that instance of AssocObject and the Child are also deleted. So in my view I do: del parent.associatedobjects I have changed the model so

Re: [sqlalchemy] Correct way to delete Association Objects

2011-08-24 Thread Michael Bayer
cascade should be all, delete-orphan.by saying delete, delete-orphan you cancel out other cascades that are there, most notably save-update which makes sure everything gets moved into the same Session. On Aug 24, 2011, at 7:07 AM, Benjamin Sims wrote: I have a many-to-many relationship