It would be nice to be able to structure this drop-down with opt-groups
https://www.w3schools.com/tags/tag_optgroup.asp
As a suggestion, the "format" for this could be similar to the way Choices
are made as seen in the example for `MEDIA_CHOICES` here
https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.Field.choices
--
Ticket URL: <https://code.djangoproject.com/ticket/33807>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "Screenshot 2022-06-28 at 09.52.55.png" added.
Screenshot of grouped actions.
* status: new => closed
* type: Uncategorized => New feature
* resolution: => wontfix
Comment:
This should already be possible overriding
`ModelAdmin.get_action_choices()`
([https://github.com/django/django/blob/bff5c114be2b7a3fbc735c232abcc6ad4db89a9d/django/contrib/admin/options.py#L1022
src])
This returns an iterable to be assigned to the form field's `choices`, so
grouping them works as expected:
[[Image(https://code.djangoproject.com/raw-
attachment/ticket/33807/Screenshot%202022-06-28%20at%2009.52.55.png)]]
Historically, e.g. #19235, requests have centred around not using a select
at all, since the number of actions is typically low, so I don't think
expanding the documentation here is worthwhile.
--
Ticket URL: <https://code.djangoproject.com/ticket/33807#comment:1>