Django

Code

Ticket #9849 (closed: duplicate)

Opened 1 year ago

Last modified 1 year ago

select_related in admin change_list

Reported by: krylatij Assigned to: nobody
Milestone: Component: django.contrib.admin
Version: SVN Keywords: select_related list_select_related
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When ForeignKey field appears in list_display django automaticaly executes select_related() for my model. So in my case it generates query with about 17 joins. =( It will be great to manage which fields to query. additional info here: http://groups.google.com/group/django-developers/browse_thread/thread/491053c89078a3ff

So it's pretty easy to fix without backward incompatibility changes. As i understand you need to change only django\contrib\admin\views\main.py and django\contrib\admin\validation.py

Attachments

Change History

02/22/09 11:49:44 changed by ramiro

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to duplicate.
  • needs_tests changed.
  • needs_docs changed.

I'm closing this as a duplicate of #9554 and will put a note there pointing back here.

02/25/09 13:51:44 changed by

  • milestone deleted.

Milestone post-1.0 deleted


Add/Change #9849 (select_related in admin change_list)




Change Properties
Action