Getting Started
Description
Admin custom filter package is a package will let you customize the view for the data in admin panel for each model dynamically.
Why this package has been developed ?
Basically when you want to add custom filters, custom searches, and custom list displays, You need to add the values you want in hard coded. But if someone uses the admin panel and he has no technical knowledge to update the code. He will ask the developer each time to update the codes and wait the development process to finish.
How this package will benefit ?
- The admin custom filter package will help to play around with all models' fields dynamically. So, any update in the filter will be reflected directly and immediately in the platform.
- Let say there are more than one admin in the platform, each one of them will have its unique filter. So, no overlap between them.
What you need to do ?
- Install the package
pip install admin-custom-filter
- Add the app name in installed apps in settings.py and configure the templates
Make sure to have APP_DIRS to True and add BASE_DIR / "admin_custom_filter" / "templates" to DIRS list
INSTALLED_APPS = [
'admin_custom_filter',
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
BASE_DIR / "admin_custom_filter" / "templates"
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
- After installing the package, make sure to have AUTH_USER_MODEL from the settings file.
EX:
inside settings.py
AUTH_USER_MODEL = "authentication.user"
- Run migration
python manage.py makemigrations
python manage.py migrate
OR
python3 manage.py makemigrations
python3 manage.py migrate
- Add the custom filter class to the models you want as the parent class inside admin.py file.
Ex:
from admin_custom_filter.admin_filter import AdminCustomFilter
class Countries(AdminCustomFilter):
pass
- Save and go to the admin panel. Then select the model that has the admin custom filter.
- You will see button Custom filter.
Metadata
Release files for admin-custom-filter 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| admin_custom_filter-1.0.8.tar.gz | 13.2 kB | Without provenance | Details for admin_custom_filter-1.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| admin_custom_filter-1.0.8-py3-none-any.whl | Python 3 | none | any | Details for admin_custom_filter-1.0.8-py3-none-any.whl |
Total release size: 31.2 kB
Release files / admin_custom_filter-1.0.8.tar.gz
| Download URL | admin_custom_filter-1.0.8.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
031f815df0835a333d6f346ec808d6a1df530d7afc14e6f83b1bef9c558d879f
|
|
BLAKE2b-256 checksum How to use checksums |
56df73cf4911cfad66286205a8cf01ee241b822dccdfe283e522ce24b2111193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Release files / admin_custom_filter-1.0.8-py3-none-any.whl
| Download URL | admin_custom_filter-1.0.8-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a3bd48e261d7b8f6a6551927dd8258f2c8341b2604a756b20f2ced08f2c0b1e
|
|
BLAKE2b-256 checksum How to use checksums |
2d81f2d9bc30e9b9618db5c0890437ac6878dd3eb0fb68c37561db522e194fb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Security for admin-custom-filter 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.