diff options
| author | Rodrigo Vieira <rodrigo.vieira@gmail.com> | 2026-04-22 18:53:27 -0300 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-04-22 22:22:55 -0400 |
| commit | fa2a3de6ede10b005fc2c1d23f4cffb53eaec425 (patch) | |
| tree | 2fbb49592272a9b5b54ae9457ba0e2072dabe74f /django/contrib/admin/options.py | |
| parent | a586f03f36f511064f171c0e30f4ca2ebfd60085 (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/options.py')
| -rw-r--r-- | django/contrib/admin/options.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 71d4a2d55c..e5502c42d5 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -662,6 +662,7 @@ class ModelAdmin(BaseModelAdmin): add_form_template = None change_form_template = None change_list_template = None + delete_confirmation_max_display = None delete_confirmation_template = None delete_selected_confirmation_template = None object_history_template = None @@ -2287,6 +2288,7 @@ class ModelAdmin(BaseModelAdmin): "object": obj, "escaped_object": display_for_value(str(obj), EMPTY_VALUE_STRING), "deleted_objects": deleted_objects, + "delete_confirmation_max_display": self.delete_confirmation_max_display, "model_count": dict(model_count).items(), "perms_lacking": perms_needed, "protected": protected, |
