Opened 18 years ago

Closed 15 years ago

Last modified 15 years ago

#2238 closed enhancement (wontfix)

select_related should fetch reverse relations

Reported by: derelm Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: bronger@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

select_related on a certain model A only fetches tables that are referenced from within that model A.

i think it should also fetch those models B that define a relation to A.

Change History (6)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: wontfix
Status: newclosed

This wouldn't work, if you think about it, because of the nature of the underlying SQL.

comment:2 by Torsten Bronger, 16 years ago

Maybe I didn't understand this report correctly, but http://rubynugs.blogspot.com/2008/07/couple-of-stupid-things-about-djano.html claims that this actually works in Rails.

comment:3 by Torsten Bronger, 16 years ago

Cc: bronger@… added

comment:4 by __alex__, 15 years ago

Resolution: wontfix
Status: closedreopened

I know this is quite old, but is this planned to be included in the orm at some point ?
If not, is it possible to get an explanation on why is this considered impossible ?

comment:5 by Karen Tracey, 15 years ago

Resolution: wontfix
Status: reopenedclosed

Please read: http://docs.djangoproject.com/en/dev/internals/contributing/#id1, which notes you should ask for a wontfix explanation on the django-developers list, not by reopening the ticket.

comment:6 by Carl Meyer, 15 years ago

Since r12307 the ORM does follow reverse one-to-one fields.

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