Opened 10 years ago
Last modified 10 years ago
#23550 closed Cleanup/optimization
Normalize implementation of SingleRelatedObjectDescriptor.get_queryset() and ReverseSingleRelatedObjectDescriptor.get_queryset(). — at Version 1
Reported by: | Loic Bistuer | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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
.
Note:
See TracTickets
for help on using tickets.