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.
- MultiSelectRelatedOnlyDropdownFilter
Multi select dropdown filter for relation fields with choices limited to the objects involved in that relation.
- 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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4d3a3bf0367763a887dceca4b469e467ad062a9e8da1c29b6d6137c5b0e3cd |
|
MD5 | 2fc739c96525c78667e9d8011a73cc38 |
|
BLAKE2b-256 | 1670dee68c41a06c93aee91c79f4599d2387d0f100168d6e2d6e0d1f50e64b05 |
Hashes for django_more_admin_filters-1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5dd9e8b55d85638d5e260dfb694b1903288b61c37e655b9443b70a5f36833f |
|
MD5 | 45f14b309876447bf40a4798d3b89953 |
|
BLAKE2b-256 | 487ccdac596f68df045ebfab6ee46b5787692509bcb61da2c8d63bad8f4a6ab9 |