#10722: Changelist view does not use select_related() on a nullable foreign key
-------------------------------------------+--------------------------------
Reporter: mrts | Owner: nobody
Status: closed | Milestone:
Component: django.contrib.admin | Version: SVN
Resolution: invalid | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by kmtracey):
* status: new => closed
* resolution: => invalid
Comment:
Admin doesn't introspect the model and decide not to use select_related()
if null=True on a !ForeignKey. Rather, select_related() itself does not
follow null=True !ForeignKeys, as documented:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related
"Note that, by default, select_related() does not follow foreign keys that
have null=True."
This strikes me as another case where if you want to control the queries
the admin is going to issue to this level of detail, you'll need to
specify the !ModelAdmin queryset() yourself.
--
Ticket URL: <http://code.djangoproject.com/ticket/10722#comment:2>
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
-~----------~----~----~----~------~----~------~--~---