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
File details
Details for the file django_more_admin_filters-1.9.tar.gz
.
File metadata
- Download URL: django_more_admin_filters-1.9.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b51bee07576076b4e236720ebd713a91fe30310fe3a413c90000da4b0cdbe44f |
|
MD5 | af27390101df58a57637e4d445ba70d3 |
|
BLAKE2b-256 | 9ed10b5af990cf176dc86cd082189e0305d5730e74a5a5d5ce6a4f1641da782c |
File details
Details for the file django_more_admin_filters-1.9-py3-none-any.whl
.
File metadata
- Download URL: django_more_admin_filters-1.9-py3-none-any.whl
- Upload date:
- Size: 65.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30161089a05c0dba83b601b0b0b341bc8ea2614b59ff849d82cb3546c06db92 |
|
MD5 | 6c74812b6553c1c9fdc138452b446d7f |
|
BLAKE2b-256 | 2b399de2c1cb7ee88725c1862b3e31020a8a4996e5e82dff15362d6766da06e3 |