[Django] #34031: Option to remove "all" option in admin SimpleListFilter

129 views
Skip to first unread message

Django

unread,
Sep 22, 2022, 5:01:45 PM9/22/22
to django-...@googlegroups.com
#34031: Option to remove "all" option in admin SimpleListFilter
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
dunderrrrrr |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.0
contrib.admin | Keywords: list_filter,
Severity: Normal | choices, simplelistfilter
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
In order to remove the "All" option from admin list filters you have to
override the `choices` function. There should be an easier way to do this.

More details can be found in this stackoverflow thread. It seems like this
is a requested feature.
https://stackoverflow.com/questions/53821727/django-admin-list-filter-
remove-all-option

--
Ticket URL: <https://code.djangoproject.com/ticket/34031>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 23, 2022, 10:10:51 AM9/23/22
to django-...@googlegroups.com
#34031: Option to remove "all" option in admin SimpleListFilter
-------------------------------------+-------------------------------------
Reporter: dunderrrrrr | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: wontfix
Keywords: list_filter, | Triage Stage:
choices, simplelistfilter | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix
* easy: 1 => 0


Comment:

Thanks for the ticket, however Django Admin is not a
[https://docs.djangoproject.com/en/stable/ref/contrib/admin/#module-
django.contriab.admin universal tool for building an app] and adding a new
hook to the `ModelAdmin` is always controversial (we already have many of
them). Also, there is not much overhead in overwriting
`SimpleListFilter.choices()`.

--
Ticket URL: <https://code.djangoproject.com/ticket/34031#comment:1>

Reply all
Reply to author
Forward
0 new messages