Opened 10 years ago
Closed 10 years ago
#23396 closed Bug (fixed)
Regression in #14334 causes ValueError to be thrown on ValuesQuerySets
Reported by: | Gabe Jackson | Owned by: | Gabe Jackson |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Tim Graham, Gabe Jackson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
check_related_objects shouldn't be called for ValuesQuerySets. This will lead to a ValueError 'Cannot use QuerySet for 'x': Use a QuerySet for 'y when doing something like:
Author.objects.filter(book__in=Author.objects.values_list('pk'))
whereas this is fine:
Author.objects.filter(book__pk__in=Author.objects.values_list('pk'))
The prior syntax used to work in django <1.8 before #14334 and #23266 were applied.
Pull request with fix and test to follow.
Change History (8)
comment:1 by , 10 years ago
Cc: | added |
---|---|
Component: | Uncategorized → Database layer (models, ORM) |
Easy pickings: | unset |
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Cc: | removed |
---|---|
Component: | Database layer (models, ORM) → Uncategorized |
Easy pickings: | set |
Has patch: | set |
Severity: | Release blocker → Normal |
Triage Stage: | Accepted → Unreviewed |
Pull Request is here: https://github.com/django/django/pull/3150
comment:3 by , 10 years ago
Cc: | added |
---|
comment:4 by , 10 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 10 years ago
Easy pickings: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Left some cosmetic comments, otherwise LGTM.
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(Affects master only)