summaryrefslogtreecommitdiff
path: root/django/contrib/admin/actions.py
AgeCommit message (Collapse)Author
2026-04-22Fixed #10919 -- Added delete_confirmation_max_display to ModelAdmin.Rodrigo Vieira
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.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2024-08-07Fixed #35639 -- Improved admin's delete confirmation page title.Matthias Kestenholz
2023-10-31Fixed #34462 -- Made admin log actions in bulk.Akash Kumar Sen
This also deprecates ModelAdmin.log_deletion() and LogEntryManager.log_action().
2023-04-22Refs #34462 -- Fixed queryset antipattern when processing object deletion.nessita
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-13Refs #32681 -- Fixed VariableDoesNotExist when rendering some admin template.Mariusz Felisiak
Regression in 84609b3205905097d7d3038d32e6101f012c0619. Follow up to 4e5bbb6ef2287126badd32842b239f4a8a7394ca. Thanks Sourav Kumar for the report.
2021-01-13Fixed #16117 -- Added decorators for admin action and display functions.Nick Pope
Refs #25134, #32099.
2018-06-18Fixed #29419 -- Allowed permissioning of admin actions.Carlton Gibson
2018-02-24Fixed #17962 -- Added ModelAdmin.get_deleted_objects().Becky Smith
2018-02-24Removed using argument from admin's get_deleted_objects().Tim Graham
2018-02-21Removed unused opts argument from admin's get_deleted_objects().Tim Graham
Unused since e12b3199d0c01694ca6b09add5e0f27cadffc8ad.
2018-01-05Fixed #15522 -- Added ModelAdmin.delete_queryset() to customize "delete ↵Vasilis Aggelou
selected objects" deletion.
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-05-25Fixed docstring typo in django/contrib/admin/actions.py.Yuichi Fujikawa
2017-04-27Refs #27795 -- Replaced many force_text() with str()Claude Paroz
Thanks Tim Graham for the review.
2017-02-22Fixed typos in code comments.Anton Samarchyan
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-01-31Used model_ngettext in two more placesClaude Paroz
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-03-29Fixed #21734 -- Handled ProtectedError in a POST to admin's delete_selected ↵Akshesh
action.
2015-12-05Fixed #25165 -- Removed inline JavaScript from the admin.Thomas Grainger
This allows setting a Content-Security-Policy HTTP header (refs #15727). Special thanks to blighj, the original author of this patch.
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-02-25Fixed #24411 -- Avoided dict key/method clash in admin delete views.Tim Graham
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-12-31Fixed #22295 -- Replaced permission check for displaying admin user-toolsThomas Tanner
2014-12-28Deprecated current_app in TemplateResponse and render(_to_response).Aymeric Augustin
2014-11-25Fixed #23898 -- Added missing context to admin's deleted_selected view.Redouane Zait
Thanks Redouane Zait for the report.
2014-08-14Fixed #20133 -- Added summary to admin deletion confirmation pages.areski
Thanks jonash for the suggestion and initial patch.
2013-12-22Used application verbose names in the admin.Aymeric Augustin
2013-10-31Started attackign the next flake8 violationAlex Gaynor
2013-09-16Fixed #17627 -- Renamed util.py files to utils.pyTim Graham
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
2013-06-19Itty bitty typo fix.Christian Metts
"deletes" was missing it's last e.
2013-04-08Fix #20111 Added more precise message level for succcess and warning messagesKaspars Sprogis
2013-02-05Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2011-07-30Removed deprecated admin contrib app AdminSite root_path attribute. Refs ↵Ramiro Morales
#15294, r11250, r16136. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22Fixed #15008 -- Replaced all calls in the admin to render_to_response with ↵Jannis Leidel
TemplateResponses for easier customization. Thanks to Chris Adams for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-20Poured a little more perfectionism into the delete-confirmation templates.Carl Meyer
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-20Fixed #14672 - Added admin handling for on_delete=PROTECT. Thanks to jtiai ↵Carl Meyer
for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-09Fixed #7539, #13067 -- Added on_delete argument to ForeignKey to control ↵Carl Meyer
cascade behavior. Also refactored deletion for efficiency and code clarity. Many thanks to Johannes Dollinger and Michael Glassford for extensive work on the patch, and to Alex Gaynor, Russell Keith-Magee, and Jacob Kaplan-Moss for review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-01Removed dead compatibility code for removed AdminSite.root() method for ↵Carl Meyer
mounting admin urls. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14412 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-12Fixed #14425 -- Unused imports in contrib.admin. Thanks robhudson.Chris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee
workarounds. Thanks to timo and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-05Fixed #11949 -- Added a hook to allow ModelAdmin customization of the delete ↵Russell Keith-Magee
selected template. Thanks to bendavis78 for the report and patch, and Ramiro Morales for his cleanup work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-26Fixed #6191, #11296 -- Modified the admin deletion confirmation page to use ↵Russell Keith-Magee
the same object collection scheme as the actual deletion. This ensures that all objects that may be deleted are actually deleted, and that cyclic display problems are avoided. Thanks to carljm for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08Fixed #10997: fixed a Python 2.4-ism in admin actions.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10705 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-06Made a bunch of improvements to admin actions. Be warned: this includes one ↵Jacob Kaplan-Moss
minor but BACKWARDS-INCOMPATIBLE change. These changes are: * BACKWARDS-INCOMPATIBLE CHANGE: action functions and action methods now share the same signature: `(modeladmin, request, queryset)`. Actions defined as methods stay the same, but if you've defined an action as a standalone function you'll now need to add that first `modeladmin` argument. * The delete selected action is now a standalone function registered site-wide; this makes disabling it easy. * Fixed #10596: there are now official, documented `AdminSite` APIs for dealing with actions, including a method to disable global actions. You can still re-enable globally-disabled actions on a case-by-case basis. * Fixed #10595: you can now disable actions for a particular `ModelAdmin` by setting `actions` to `None`. * Fixed #10734: actions are now sorted (by name). * Fixed #10618: the action is now taken from the form whose "submit" button you clicked, not arbitrarily the last form on the page. * All of the above is documented and tested. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10408 bcc190cf-cafb-0310-a4f2-bffc1f526a37