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

2022-05-27 Thread Nathan Johnson
that isn't associated with a > Session. If you organize your application to deal with objects only > within the scope of a single session, and never once that session has been > closed, you won't get that error message. > > > > On Mon, May 16, 2022, at 12:07 PM, N

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

2022-05-16 Thread Nathan Johnson
tern. > > there's more guidelines on Session use at > https://docs.sqlalchemy.org/en/14/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it > > > On Wed, May 11, 2022, at 6:24 AM, Nathan Johnson wrote: > > Hi > > I&#x

[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

[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