#11604: ChangeList should pass depth=1 to .select_related()
---------------------------------------------+------------------------------
Reporter: [email protected] | Owner: nobody
Status: closed | Milestone: 1.3
Component: django.contrib.admin | Version: 1.0
Resolution: wontfix | Keywords: efficient-admin
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Changes (by julien):
* status: new => closed
* resolution: => wontfix
Comment:
It is quite common to require access to the related models, for example to
use as list filters, so it makes sense that Django uses select_related().
However, by arbitrarily using a specific depth of 1 (or whatever number),
Django would be taking a guess about what performance trick would work for
the majority of sites. A depth of 1 may work well with your use case, but
pretty poorly in others. For what it's worth, in 4+ years using Django in
many projects I've rarely witnessed such performance issues in the admin,
even with MySQL. I'm not saying that your use case doesn't exist, but it
doesn't seem like it is common enough to justify changing Django's default
behaviour. What's more is that ModelAdmin already offers some hooks to get
exactly what you want, as illustrated in ishirav's code snippet above.
--
Ticket URL: <http://code.djangoproject.com/ticket/11604#comment:8>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.