Re: [sqlalchemy] Cascade delete-orphan: reattach child to another parent

2018-03-31 Thread Serhii Mozghovyi
t; attributes.set_committed_value(oldvalue, "address", None) > > > the "set_committed_value" is to avoid triggering any new events which > will cause a recursion overflow. > > > > On Wed, Mar 28, 2018 at 10:49 AM, Serhii Mozghovyi > wrote: > >

[sqlalchemy] Cascade delete-orphan: reattach child to another parent

2018-03-28 Thread Serhii Mozghovyi
Is it possible to make child objects (many-to-one side) delete itself from the old parent's collection when it is added to a different parent? See the file attached. The old parent remains unaware that he doesn't have this child anymore. P.S. session.expire() is an obvious solution but too heav