Code

Opened 8 years ago

Closed 4 years ago

Last modified 4 years ago

#2238 closed enhancement (wontfix)

select_related should fetch reverse relations

Reported by: derelm Owned by: adrian
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.

Attachments (0)

Change History (6)

comment:1 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

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

comment:2 Changed 6 years ago by bronger

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 Changed 6 years ago by bronger

  • Cc bronger@… added

comment:4 Changed 4 years ago by __alex__

  • Resolution wontfix deleted
  • Status changed from closed to reopened

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 Changed 4 years ago by kmtracey

  • Resolution set to wontfix
  • Status changed from reopened to closed

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 Changed 4 years ago by carljm

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.