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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 644709698a6794e9aa5bdd17594b2c7f729165f55a2bdcfac19b992c8dfd56d8 |
|
MD5 | 18d693a822b585659a69c2fdb961e337 |
|
BLAKE2b-256 | 7937dbc5c58819b9c1f8300fa2fc1b648f23205b932f3c8ccf8a087b014b1db9 |
Hashes for django_more_admin_filters-1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e081d66483616bedd45925ccbd10e437e88046ecc16727929eb0c4992f52af0 |
|
MD5 | 36d766a279bf0b634dab3bd811f65608 |
|
BLAKE2b-256 | 6455ff101ca27f9baefa809c6e0588c2caaa341938b86bbfd12a5f3138e0f9c1 |