Additional filters for django-admin.
Project description
Description
Django-more-admin-filters is a collection of django admin filters with a focus on filters using dropdown widgets, multiple choice filters and filters working with annotated attributes.
Installation
Install from pypi.org:
pip install django-more-admin-filters
Add more_admin_filters to your installed apps:
INSTALLED_APPS = [ 'more_admin_filters', ... ]
Use the filter classes with your ModelAdmin:
from more_admin_filters import MultiSelectDropdownFilter class MyModelAdmin(admin.ModelAdmin): ... list_filter = [ ('myfield', MultiSelectDropdownFilter), ... ]
Since the ModelAdmin routine to initialize the list filters doesn’t work with annotated attributes the usage for an annotation filter is a little bit special. The filter class needs to be equipped with the attribute’s name:
MyModelAdmin(admin.ModelAdmin): list_filter = [ BooleanAnnotationFilter.init('my_annotated_attribute'), ... ]
Filter classes
- DropdownFilter
Dropdown filter for all kind of fields.
- ChoicesDropdownFilter
Dropdown filter for fields using choices.
- RelatedDropdownFilter
Dropdown filter for relation fields.
- RelatedOnlyDropdownFilter
Dropdown filter for relation fields using limit_choices_to.
- MultiSelectFilter
Multi select filter for all kind of fields.
- MultiSelectRelatedFilter
Multi select filter for relation fields.
- MultiSelectDropdownFilter
Multi select dropdown filter for all kind of fields.
- MultiSelectRelatedDropdownFilter
Multi select dropdown filter for relation fields.
- BooleanAnnotationFilter
Filter for annotated boolean-attributes.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-more-admin-filters-1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6fd7c18b1c103a4275abf65cf048d4cc25969f26653aa11ee2dcd7be88ad25a |
|
MD5 | c017def7df5851c373d308303b7065c9 |
|
BLAKE2b-256 | c4a967b038cd14193b46ab367573d80974265e8298bc2ef4be11c4910e98553b |
Hashes for django_more_admin_filters-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 055746ac0a68b2fed498a53b9690a6c5b05e25e6c4166b1c42cc74e2aec0e61f |
|
MD5 | 123c3459d842874c3a66d05668b78c7f |
|
BLAKE2b-256 | 77454fe0744f0a627fe20aeebc040c5e66e8c2d4700e8b5f85f4819e8ec9660b |