Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Admin list_filter getting too long

The change_list view of my model looks like this:

enter image description here

The list_filter at the right side is getting too long and unusable.

Is there a way to get a more useable way to filter the change_list view of Django?

like image 727
guettli Avatar asked Jan 01 '23 18:01

guettli


2 Answers

You could try using dal_admin_filters its Django autocomplete light filters for django admin

https://pypi.org/project/dal_admin_filters/

Looks like it may be what you're looking for

enter image description here

like image 129
Kamil Niski Avatar answered Jan 12 '23 04:01

Kamil Niski


While dal_admin_filters seems to work it hasn't been updated in a while (2017) and predates the introduction of auto-complete fields in Django 2.0.

If I was you I'd try my luck at implementing my own SimpleListFilter subclass based on the new auto-complete endpoints exposed in Django 2.0 and dal_admin_filters implementation.

like image 24
Simon Charette Avatar answered Jan 12 '23 03:01

Simon Charette