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.
- MultiSelectRelatedOnlyFilter
Multi select filter for related fields with choices limited to the objects involved in that relation
- 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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67fad47ea63d8ac1f0f1c3a25850004197656cb573b2d1584077d6765b9354ef |
|
MD5 | 56144edf9e54ba32901b2404ffb9c03f |
|
BLAKE2b-256 | ab8717e059f726a17d0a1562cea90f1203f4b06a2b4660f482dc58d160f9d2e1 |
Hashes for django_more_admin_filters-1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2162a084d7233c4d892cf6a0d0ae8a0b9bc0213815fbb8840df8e0b970c8c07 |
|
MD5 | f30068c6eafb8e04cb2f4326373556fd |
|
BLAKE2b-256 | 33b7ed19c072a142db7662217a7a97b9a27c60443c75d759025d93261d143939 |