#16865: get_or_create defaults to _for_write even when it's just reading
-------------------------------------+-------------------------------------
Reporter: Rick van Hattem | Owner: nobody
<Rick.van.Hattem@…> | Status: closed
Type: Bug | Version: 1.3
Component: Database layer | Resolution: wontfix
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Comment (by trbs):
Replying to [comment:16 carljm]:
> Closing as wontfix, as after discussion with jdunck I no longer see how
we can do this and still guarantee correctness. We can reopen if somebody
can make a proposal that addresses the type of problem outlined above.
I agree I don't see an easy way out of this problem. Pretty sure me and
the reporter of this ticket only use get_or_create() in situation where we
never delete the object that is potentially created by get_or_create().
Could we at least put a little hint in the documentation of
get_or_create() that notes that this function will always use the for-
write database via db routers for consistency ? That way future people are
warned not to expect this to scale over multiple databases.
--
Ticket URL: <https://code.djangoproject.com/ticket/16865#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.