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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 072cf32ae559d24c31fe774e535155e74e9ed69fc125ce1f4d8777a197238551 |
|
MD5 | 4d17e827c0910f0f0d11bc02862a35a8 |
|
BLAKE2b-256 | 4de16dee6d47c759451cf132a203b84b6d2eca21e03e9e053e680afef099593d |
Hashes for django_more_admin_filters-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6a998a3a654bcc15ecf1167281b9c05ee8a9e3dd52edd24bf1051d3a301c8a8 |
|
MD5 | 371b5e198b3b98e1f090a848ef34e647 |
|
BLAKE2b-256 | 08063b62f4ff509be3edcb29cb2d2ea42a58f849b0ce4b4852acc16602a1343d |