A generic filter for the django-admin-page based on django-filter.
Project description
Description
Django-admin-filter is a generic form-based filter for the django-admin-page. It is based on django-filter. It provides a flexible and direct way to filter the items of your changelist and to save and reuse your queries.
Installation
Install from pypi.org:
pip install django-admin-filter
Configuration
There are three things you need to do to use a custom filter-form for your model in your admin changelist:
Add django_admin_filter to your INSTALLED_APPS:
INSTALLED_APPS = [ 'django_admin_filter', ... ]
Add the CustomFilter to the list_filter of your ModelAdmin:
from django_admin_filter.filters import CustomFilter class MyAdmin(admin.ModelAdmin): list_filter = [CustomFilter, ...] ...
And setup the filter-class you want to use with your model. This works exactly as described in the django-filter-docs. But to use your filter-class with the django-admin-filter there is one thing to mind: Instead of subclass django_filters.FilterSet:
import django_filters class MyFilter(django_filters.FilterSet): ...
use the AdminFilterSet:
from django_admin_filter.filterset import AdminFilterSet class MyFilter(AdminFilterSet): ...
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-admin-filter-0.1.tar.gz.
File metadata
- Download URL: django-admin-filter-0.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98c0c9e2aafb013c4069b0f97b62b7dfce2d0bc05a11629432ed26bab4167daa
|
|
| MD5 |
4f7a67a3d34ac9f3ee80bbd0d03863f6
|
|
| BLAKE2b-256 |
fbd3e6ea1a862865c8c753a2b915e0127158948850b2f70cf3ae025b29cd36ab
|
File details
Details for the file django_admin_filter-0.1-py3-none-any.whl.
File metadata
- Download URL: django_admin_filter-0.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c3729cede275cd4d59c1bf800ae2c4a2a4977ab7dc4dd251a0bc7f02fe36f6b
|
|
| MD5 |
44bec55643a7bf56825086a92637b472
|
|
| BLAKE2b-256 |
332920386a0a60907b979be1ce29c6595bbff89303d35baff551b4384d5097a3
|