#30894: Reverse OneToOneField relation: `prefetch_related` uses `related_name`
while `select_related` uses `related_query_name`
-------------------------------------+-------------------------------------
Reporter: Adam Sołtysik | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 2.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
I think this should be addressed, it doesn't make much sense that
`related_query_name` is used everywhere but in `prefetch_related`. It was
probably simply overlooked in `prefetch_related` given it works in
`select_related`.
It should not be too hard to deprecate given the rare usages of
`related_query_name` by accepting both `related_query_name` and
`related_name` during the deprecation period and warning when
`related_name != related_query_name` and `related_name` is used.
--
Ticket URL: <https://code.djangoproject.com/ticket/30894#comment:6>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.b24c03cd15a2942ddd436c83b10afd46%40djangoproject.com.