diff options
| author | Adam Johnson <me@adamj.eu> | 2025-09-05 11:54:01 +0100 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-05-11 12:32:30 -0400 |
| commit | 0c634de4e6950ec6fb83ab420b4af9c645b28acd (patch) | |
| tree | eefd88cbe884f0c1f3f8707ea3e7f731d29613c6 /docs | |
| parent | 4d455ae2d7689ce066dfffef9fc29a6f6d3ed33e (diff) | |
Refs #36593 -- Made ModelAdmin.list_select_related = False more efficient.
This change makes `list_select_related = False` avoid unnecessary joins by only
selecting the related fields that are actually used in `list_display`.
Consequently, it avoids one code path that calls `QuerySet.select_related()`
with no arguments, which is targeted for deprecation.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/6.1.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt index 412a997019..89ff52be4d 100644 --- a/docs/releases/6.1.txt +++ b/docs/releases/6.1.txt @@ -99,6 +99,11 @@ Minor features preserve :ref:`named groups <field-choices-named-groups>` (e.g. ``choices=[("Group", [("1", "Item")]), ...]``). +* When :attr:`.ModelAdmin.list_select_related` is ``False`` (the default), + the change list now selects only the foreign key fields specified in + :attr:`.ModelAdmin.list_display`, rather than all foreign key fields. This + should improve performance for models with many foreign key fields. + * The :attr:`~django.contrib.admin.ModelAdmin.delete_confirmation_max_display` option allows customizing how many objects are displayed on admin delete confirmation pages before the remainder is truncated. The default is @@ -480,6 +485,9 @@ backends. * The undocumented ``InclusionAdminNode.__init__()`` now takes the template tag ``name`` as the first positional argument. +* The undocumented ``ChangeList.has_related_field_in_list_display()`` method + has been replaced with ``ChangeList.get_select_related_fields()``. + :mod:`django.contrib.auth` -------------------------- |
