Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
django-unfold-admin-list-filter-dropdown
Advanced tools
[!NOTE]
This version is compatible with django-unfold.
A Django admin filter implementation that renders as a dropdown.
If you have more than ten values for a field that you want to filter by in Django admin, the filtering sidebar gets long, cluttered and hard to use.
This app contains the DropdownFilter
class that renders as a drop-down in the
filtering sidebar to avoid this problem.
Install:
pip install django-unfold-admin-list-filter-dropdown
Enable in settings.py
:
INSTALLED_APPS = (
...
'django_unfold_admin_listfilter_dropdown',
...
)
Use in admin.py
:
from django_admin_listfilter_dropdown.filters import DropdownFilter, RelatedDropdownFilter, ChoiceDropdownFilter
class EntityAdmin(admin.ModelAdmin):
...
list_filter = (
# for ordinary fields
('a_charfield', DropdownFilter),
# for choice fields
('a_choicefield', ChoiceDropdownFilter),
# for related fields
('a_foreignkey_field', RelatedDropdownFilter),
)
Example of a custom filter that uses the provided template:
class CustomFilter(SimpleListFilter):
template = 'django_unfold_admin_listfilter_dropdown/dropdown_filter.html'
def lookups(self, request, model_admin):
...
def queryset(self, request, queryset):
...
FAQs
Use dropdowns in Django admin list filter
We found that django-unfold-admin-list-filter-dropdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.