Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions docs/ref/contrib/admin/actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,21 @@ The ``action`` decorator

In this case it will add no attributes to the function.

Action descriptions are %-formatted and may contain ``'%(verbose_name)s'``
and ``'%(verbose_name_plural)s'`` placeholders, which are replaced,
respectively, by the model's :attr:`~django.db.models.Options.verbose_name`
and :attr:`~django.db.models.Options.verbose_name_plural`.
:param permissions: A list of permission codenames that restrict the action
to users who have at least one of the defined permissions. This sets
the ``allowed_permissions`` attribute on the function. See
:ref:`admin-action-permissions` for details.

:param description: A human-readable description of the action to be
rendered in the admin. If ``description`` is not provided, Django
renders the function's name, converting underscores to spaces and
capitalizing the first letter of the first word. This sets the
``short_description`` attribute on the function.

.. admonition:: Action description ``%``-formatting support

Action descriptions support ``%``-formatting and may include
``'%(verbose_name)s'`` and ``'%(verbose_name_plural)s'`` placeholders.
These are replaced with the model’s
:attr:`~django.db.models.Options.verbose_name` and
:attr:`~django.db.models.Options.verbose_name_plural`.
1 change: 1 addition & 0 deletions docs/spelling_wordlist
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ codebase
codec
codename
codenamed
codenames
coercible
commenters
conf
Expand Down
3 changes: 1 addition & 2 deletions tests/admin_views/test_related_object_lookups.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from selenium.common.exceptions import TimeoutException

from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.auth.models import User
from django.test import override_settings
Expand Down Expand Up @@ -183,6 +181,7 @@ def test_related_object_add_js_actions(self):
)

def test_child_popup_not_closed_when_parent_minimized(self):
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By

album_add_url = reverse("admin:admin_views_album_add")
Expand Down
Loading