Re: [sqlalchemy] Delete orphan occurs even before commit happens and when expunge happens

2017-04-03 Thread mike bayer
On 04/03/2017 11:48 AM, Shane Carey wrote: So the reason the children are marked for delete is because they are no longer associated with the parent, and for that same reason the expunge does not propagate to them. As much as I wish this would work for me, I have to agree with you. Is there an

Re: [sqlalchemy] Delete orphan occurs even before commit happens and when expunge happens

2017-04-03 Thread Shane Carey
So the reason the children are marked for delete is because they are no longer associated with the parent, and for that same reason the expunge does not propagate to them. As much as I wish this would work for me, I have to agree with you. Is there any way to prevent the delete from occurring on

Re: [sqlalchemy] Delete orphan occurs even before commit happens and when expunge happens

2017-04-03 Thread mike bayer
On 04/03/2017 09:52 AM, Shane Carey wrote: I am getting an error where delete orphan on a relationship seems to happen even when the parent object is expunged. I reproduced the issue in this example. from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import

[sqlalchemy] Delete orphan occurs even before commit happens and when expunge happens

2017-04-03 Thread Shane Carey
I am getting an error where delete orphan on a relationship seems to happen even when the parent object is expunged. I reproduced the issue in this example. from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import * Base = declarative_base() class Parent(Bas