Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#9926 closed (fixed)

Nullable FK to inherited model excludes results when using .select_related()

Reported by: Adam Gomaa Owned by: Malcolm Tredinnick
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Patch to the query regression test demonstrating the problem is attached. I'm pretty lost on getting a fix; it's in some hairy query code.

Present in 1.0 and trunk.

Attachments (1)

2008-12-29-select-related-subclass-null.patch (1.7 KB ) - added by Adam Gomaa 15 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Malcolm Tredinnick, 15 years ago

Owner: changed from nobody to Malcolm Tredinnick
Status: newassigned

comment:2 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Bob Thomas, 15 years ago

This looks similar to #9041. One of these could probably be marked a dupe.

comment:4 by Malcolm Tredinnick, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [10136]) Fixed #9926 -- Fixes for some select_related() situations.

Using select_related(...) across a nullable relation to a multi-table
model inheritance situation no longer excludes results. Thanks to AdamG
for a test demonstrating part of the problem.

comment:5 by Malcolm Tredinnick, 15 years ago

(In [10138]) [1.0.X] Fixed #9926 -- Fixes for some select_related() situations.

Using select_related(...) across a nullable relation to a multi-table
model inheritance situation no longer excludes results. Thanks to AdamG
for a test demonstrating part of the problem.

Backport of r10136 from trunk.

comment:6 by Jacob, 12 years ago

milestone: 1.1

Milestone 1.1 deleted

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