Re: [sqlalchemy] add/update causing InvalidRequest for object with association_proxy lookup

2022-05-11 Thread Mike Bayer
the pattern you are using with expunge() is likely creating confusion as to what objects are still in the Session and which ones aren't. I would seek to organize your application such that the entire sequence of load/manipulation operations with a set of objects proceeds under a single Sess

[sqlalchemy] Re: add/update causing InvalidRequest for object with association_proxy lookup

2022-05-11 Thread Nathan Johnson
Oh, forgot to clarify, if it wasn't obvious... The LookUp is of course in the session already for the initial object creation, it's only on updating the created object that this error manifests. On Wednesday, 11 May 2022 at 11:24:41 UTC+1 Nathan Johnson wrote: > Hi > > I'm attempting to use an

[sqlalchemy] add/update causing InvalidRequest for object with association_proxy lookup

2022-05-11 Thread Nathan Johnson
Hi I'm attempting to use an association_proxy approach to support a look up table with classical mapping. The problem I'm having is that attempting to update/add an existing object to a session causes: -- Traceback (most recent call last): File "association_proxy_poc.py", line 118, in