7
For all models
You can easily override the django admin templates to customize the admin UI.
To edit the sidebar filter, just add a templates/admin/filter.html
file, and write your custom HTML with radio buttons.
Note that this will change the sidebar filter for all models.
For a single model
If you want to change the filter for a single model, you can specify a template for a ListFilter
:
class FilterWithCustomTemplate(admin.SimpleListFilter):
template = "custom_template.html"
Example
As a reference example, check is the default template for filter.html.
3
-
Radio buttons cannot have multiple selection, you would need to make them check boxes.
-
What you are looking for is making custom filters. I would suggest instead of overwriting the Filter List to contain a check form with check boxes, add a custom filter with each option as a filter. Use this link and scroll down to the SimpleListFilter and you will be able to code it with 5-10 LOC.
- Django is very slow on my machine
- Django. ''The `actions` argument must be provided when calling `.as_view()` '' when I try to allow DELETE, PUT, ETC
- Building a Mobile App With jQuery Mobile, Django, and Phonegap