#34031 closed Cleanup/optimization (wontfix)

Option to remove "all" option in admin SimpleListFilter

Reported by: dunderrrrrr Owned by: nobody
Component: contrib.admin Version: 4.0
Severity: Normal Keywords: list_filter, choices, simplelistfilter
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (1)

comment:1 by Mariusz Felisiak, 20 months ago

Easy pickings: unset
Resolution: wontfix
Status: newclosed

Thanks for the ticket, however Django Admin is not a 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().

Note: See TracTickets for help on using tickets.
Back to Top