diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2026-04-22 08:04:30 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2026-04-23 11:54:14 +0300 |
| commit | d24160ab4855f6971aa1f437720adca6330048a2 (patch) | |
| tree | 0fe33acdc18ae967fd880be5f793a9ecef67b24e /docs | |
| parent | 183e6505b64c140ad2ad64626c52bba88fc13edd (diff) | |
Refs #12090 -- Documented parameters for contrib.admin.decorators.action().
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/actions.txt | 22 | ||||
| -rw-r--r-- | docs/spelling_wordlist | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/docs/ref/contrib/admin/actions.txt b/docs/ref/contrib/admin/actions.txt index 084caca69e..331d52cd03 100644 --- a/docs/ref/contrib/admin/actions.txt +++ b/docs/ref/contrib/admin/actions.txt @@ -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`. diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist index f963940184..8d548d6439 100644 --- a/docs/spelling_wordlist +++ b/docs/spelling_wordlist @@ -88,6 +88,7 @@ codebase codec codename codenamed +codenames coercible commenters conf |
