summaryrefslogtreecommitdiff
path: root/django/contrib/admin/utils.py
diff options
context:
space:
mode:
authorRodrigo Vieira <rodrigo.vieira@gmail.com>2026-04-22 18:53:27 -0300
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-22 22:22:55 -0400
commitfa2a3de6ede10b005fc2c1d23f4cffb53eaec425 (patch)
tree2fbb49592272a9b5b54ae9457ba0e2072dabe74f /django/contrib/admin/utils.py
parenta586f03f36f511064f171c0e30f4ca2ebfd60085 (diff)
Fixed #10919 -- Added delete_confirmation_max_display to ModelAdmin.
The new ModelAdmin.delete_confirmation_max_display attribute allows limiting the number of related objects shown on the delete confirmation page. When the limit is reached, a "…and N more objects." message is shown. The feature relies on a new truncated_unordered_list template filter added to django.contrib.admin.templatetags.admin_filters. Thanks Jacob Tyler Walls for the review and guidance, Tobias McNulty for the report, and terminator14 for the solution suggested.
Diffstat (limited to 'django/contrib/admin/utils.py')
-rw-r--r--django/contrib/admin/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/admin/utils.py b/django/contrib/admin/utils.py
index 3d5b023dea..ed6c41f52e 100644
--- a/django/contrib/admin/utils.py
+++ b/django/contrib/admin/utils.py
@@ -130,7 +130,8 @@ def get_deleted_objects(objs, request, admin_site):
must be a homogeneous iterable of objects (e.g. a QuerySet).
Return a nested list of strings suitable for display in the
- template with the ``unordered_list`` filter.
+ template with the ``unordered_list``
+ and ``truncated_unordered_list`` filters.
"""
from django.contrib.admin.options import EMPTY_VALUE_STRING