Re: Pass existing model Instance to update_or_create callables

2020-10-28 Thread Adam Johnson
Yes, it does, my bad. On Wed, 28 Oct 2020 at 17:03, James Pulec wrote: > Hey Adam, > > Thanks for the clarification. I totally get that this might be a bit too > complex, and maybe shouldn't wind up in update_or_create(), so I can > definitely just use my own manager method. I'm a little confuse

Re: Pass existing model Instance to update_or_create callables

2020-10-28 Thread James Pulec
Hey Adam, Thanks for the clarification. I totally get that this might be a bit too complex, and maybe shouldn't wind up in update_or_create(), so I can definitely just use my own manager method. I'm a little confused by this statement, though: "It doesn't actually fetch the updated model insta

Re: Pass existing model Instance to update_or_create callables

2020-10-26 Thread Adam Johnson
I think the scenario you're suggesting is just a little too complex for update_or_create. It doesn't actually fetch the updated model instance . You can instead write out what you want without too much extra code using get_or_create, ensuring there's a transaction and select_for_update() to lock th