/django/contrib/admin/templates/admin/filter.html
{% load i18n %}
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
<ul multiple>
{% for choice in choices %}
<li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
{% endfor %}
</ul>
list_filter add multiple it seem only change one item, not multiple. or any idea can help it?
Can you put here a traceback?
when i choose one item will immediate search, no chance choose multi.
any traceback in the console?
no error, i choose another method.
which one?
use jquery + apis replace django multi choices, it is hard to express in django.
@mapleflow can you explain in detail about the approach you used?
I know that django-jet is not maintained any longer but this is the approach I use to have multiple choice filtering in the jet admin: https://github.com/pierreben/django-jet/commit/3e376a5b9df549d4bf4b6fa609a4120681e657a5.
To use it, you have to create a custom filter in your modeladmin inheriting from MultipleChoiceListFilter:
from jet.filters import MultipleChoiceListFilter
class RegionsListFilter(MultipleChoiceListFilter):
title = "R茅gion"
parameter_name = "regions__in"
def lookups(self, request, model_admin):
return FRENCH_REGIONS_CHOICES
If some people are interested, I can submit a pr for this.