Re: [sqlalchemy] object “is already present in this session” when using a new session with older objects

2020-11-20 Thread Mike Bayer
On Thu, Nov 19, 2020, at 6:15 PM, Vinit Shah wrote: > I posted this on StackOverflow a few days ago, but I haven't been able to > figure this one out yet. The original post can be found here: StackOverflow: > object "is already present in this session" >

Re: [sqlalchemy] Setting Foreign Key based on natural key

2020-11-20 Thread Steven James
Thank you for taking the time to look at this. I have shied away from using events in the past, but now that you mention it I can see how that could work for this case. I had to add slightly to my previous solution. In some cases, the relationship is nullable and this solution was silently