django-admin-search-fields allows users to dynamically selecting search fields on list page
Project description
django-admin-search-fields
The django-admin-search-fields feature empowers users to dynamically select search fields on the list page of the Django admin. This capability provides flexibility and improves the user experience by allowing administrators to tailor their search queries based on the context of their data exploration needs.
Key Benefits
- Customizable Search Experience: Users can specify which fields to search on the fly, making it easier to perform targeted queries.
- Enhanced Usability: Provides an intuitive interface to select search fields, improving efficiency in data management.
- Performance Optimization: Reduces the overhead of searching across unnecessary fields, enhancing query performance.
How To Use
-
Install package with
pip install django-admin-search-fields. -
Add
django_admin_search_fieldstoINSTALLED_APPSin yoursettings.py.django_admin_search_fieldsshould placed before the used apps:
INSTALLED_APPS = [
...,
"django_admin_search_fields",
...
"your_app"
]
- Import and inherit
DjangoAdminSearchFieldModelAdminto your custom model admin class and setsearch_field_choiceslike below:
from django_admin_search_fields.admin import DjangoAdminSearchFieldModelAdmin
class PostAdmin(DjangoAdminSearchFieldModelAdmin):
search_field_choices = (
('title', True, 'Title'), # Prechecked by default
('subtitle', False), # Not prechecked by default
('author__first_name', False, _("Author's first name")) # Requires a verbose name for relational fields
)
...
admin.site.register(Post, PostAdmin)
Project details
Release history Release notifications | RSS feed
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_search_fields-0.1.3.tar.gz.
File metadata
- Download URL: django_admin_search_fields-0.1.3.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c14e3fda2d8a01339a42bb5e14ac56a7478e1f4d0f53fb9ae372b7b8bb61863c
|
|
| MD5 |
5cdcb1b0336da94f104b087ac2af2e5d
|
|
| BLAKE2b-256 |
93e73ce1a1be486f0b829623bb0a3a96ec859fe3e6ad2f136e5d1a0fe436121b
|
File details
Details for the file django_admin_search_fields-0.1.3-py3-none-any.whl.
File metadata
- Download URL: django_admin_search_fields-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5474e65cf504a8bc07988d36ea3ad83bd7f48ced4b411cdef7ea504d6205db36
|
|
| MD5 |
82d7b6ec97f622e7082c4bab014da913
|
|
| BLAKE2b-256 |
bac9e17ce976fa49764e34660496d7d35b5d41a15146ff9b93142d0edd5ccc18
|