Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dalf/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def media(self):
css={
'screen': (
'admin/css/vendor/select2/select2.min.css',
'admin/css/autocomplete.css',
'admin/css/django_admin_list_filter.css',
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ul>
<li>
{% with params=choices|last %}
<select class="django-admin-list-filter" name="{{ params.field_name }}" data-is-choices-filter="{{ params.is_choices_filter }}">
<select class="django-admin-list-filter admin-autocomplete" name="{{ params.field_name }}" data-is-choices-filter="{{ params.is_choices_filter }}" data-theme="admin-autocomplete">
{% for choice in choices %}
{% if choice.display %}<option value="{{ choice.query_string|iriencode }}"{% if choice.selected %} selected{% endif %}>{{ choice.display }}</option>{% endif %}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
data-allow-clear="true"
data-app-label="{{ params.app_label }}"
data-model-name="{{ params.model_name }}"
data-theme="admin-autocomplete"
data-field-name="{{ params.field_name }}"></select>
{% endwith %}
</li>
Expand Down
4 changes: 2 additions & 2 deletions tests/testproject/testapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test_post_admin_filters_basics(admin_client, posts): # noqa: ARG001

if option_field_name in ['author', 'audience']:
assert (
f'<select class="django-admin-list-filter" name="{option_field_name}" '
f'data-is-choices-filter="{option_is_choices_filter}">'
f'<select class="django-admin-list-filter admin-autocomplete" name="{option_field_name}" '
f'data-is-choices-filter="{option_is_choices_filter}" data-theme="admin-autocomplete">'
) in content

if option_field_name == 'author':
Expand Down
Loading