#12855 closed (fixed)
QuerySet.__or__ has bad behavior in the presence of extra
Reported by: | Alex Gaynor | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | 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
If you do something like
q = Model.objects.extra(where=["some stuff"]) | Model.objects.filter(c=d)
In this csae the where clause of the 2nd queryset gets lost because of the way they are combined. This is a symptom of the fact that extra where stuff is basically tacked onto the end of a queryset after the fact.
Attachments (1)
Change History (6)
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 15 years ago
Attachment: | django-extra-where.diff added |
---|
comment:2 by , 15 years ago
Has patch: | set |
---|
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Note:
See TracTickets
for help on using tickets.
(In [12502]) Fixed #12855 -- QuerySets with
extra
where parameters now combine correctly. Thanks, Alex Gaynor.