Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#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)

django-extra-where.diff (5.4 KB ) - added by Alex Gaynor 15 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

by Alex Gaynor, 15 years ago

Attachment: django-extra-where.diff added

comment:2 by Alex Gaynor, 15 years ago

Has patch: set

comment:3 by jbronn, 15 years ago

Resolution: fixed
Status: newclosed

(In [12502]) Fixed #12855 -- QuerySets with extra where parameters now combine correctly. Thanks, Alex Gaynor.

comment:4 by jbronn, 15 years ago

(In [12507]) Fixed #12855 -- QuerySets? with extra where parameters now combine correctly. Thanks, Alex Gaynor.

Backport of r12502 from trunk.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top