#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 Adam Sołtysik):
I think the related_query_name docs are clear enough that setting it
overrides the name of the reverse filter, and that a clarification in the
select_related() docs would only muddy the waters for the majority of
users.
OK, but why doesn't it override the name of the reverse filter in the case
of `prefetch_related()` then? My report is about the inconsistency between
`select_related()` and `prefetch_related()`. I want to use different
`related_name` and `related_query_name` in my models and I would expect
that `related_query_name` can be used in both `select_related()` and
`prefetch_related()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/30894#comment:3>
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.55341604f69725b1f5f8631f46b444a2%40djangoproject.com.