#23550: Normalize implementation of SingleRelatedObjectDescriptor.get_queryset()
and ReverseSingleRelatedObjectDescriptor.get_queryset().
-------------------------------------+-------------------------------------
Reporter: loic | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Description changed by loic:
Old description:
> `ReverseSingleRelatedObjectDescriptor.get_queryset()` instantiates a
> `QuerySet` directly which is problematic because it doesn't account for
> custom `QuerySet` types and
> `SingleRelatedObjectDescriptor.get_queryset()` doesn't honor
> `use_for_related_fields` which is inconsistent with
> `ReverseSingleRelatedObjectDescriptor`.
New description:
Both `SingleRelatedObjectDescriptor` and
`ReverseSingleRelatedObjectDescriptor` can return `Manager` instances
which is inconsistent with the name of the method `get_queryset()`.
`ReverseSingleRelatedObjectDescriptor.get_queryset()` instantiates a
`QuerySet` directly which is problematic because it doesn't account for
custom `QuerySet` types.
`SingleRelatedObjectDescriptor.get_queryset()` doesn't honor
`use_for_related_fields` which is inconsistent with
`ReverseSingleRelatedObjectDescriptor`.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/23550#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.acba4d6013b260780987d8d5541c6e5b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.