Re: [sqlalchemy] debugging DetachedInstanceError

2020-04-23 Thread Jonathan Vanasco
On Thursday, April 23, 2020 at 10:17:12 AM UTC-4, Mike Bayer wrote: > > Using the event hook is likely the most direct way to see where it's > happening, either via logging or pdb: > > >

Re: [sqlalchemy] debugging DetachedInstanceError

2020-04-23 Thread Mike Bayer
also the item can be detached if it was deleted in a previous flush On Wed, Apr 22, 2020, at 8:57 PM, Jonathan Vanasco wrote: > I'm trying to figure out how I got a DetatchedInstanceError > > > DetachedInstanceError: Parent instance is > not bound to a Session; lazy load operation of

Re: [sqlalchemy] debugging DetachedInstanceError

2020-04-23 Thread Mike Bayer
Using the event hook is likely the most direct way to see where it's happening, either via logging or pdb: https://docs.sqlalchemy.org/en/13/orm/events.html?highlight=persistent_to_detached#sqlalchemy.orm.events.SessionEvents.persistent_to_detached On Wed, Apr 22, 2020, at 8:57 PM, Jonathan

[sqlalchemy] debugging DetachedInstanceError

2020-04-22 Thread Jonathan Vanasco
I'm trying to figure out how I got a DetatchedInstanceError DetachedInstanceError: Parent instance is not bound to a Session; lazy load operation of attribute 'domain' cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3) This is happening in a web application where I