Opened 11 years ago
Closed 11 years ago
#23550 closed Cleanup/optimization (fixed)
Normalize implementation of SingleRelatedObjectDescriptor.get_queryset() and ReverseSingleRelatedObjectDescriptor.get_queryset().
| 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.
Change History (3)
comment:1 by , 11 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 11 years ago
| Has patch: | set |
|---|
comment:3 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
PR https://github.com/django/django/pull/3256.