Skip to main content

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.

After

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

  1. Install package with pip install django-admin-search-fields.

  2. Add django_admin_search_fields to INSTALLED_APPS in your settings.py. django_admin_search_fields should placed before the used apps:

    INSTALLED_APPS = [
        ...,
        "django_admin_search_fields",
        ...
        "your_app"
    ]
  1. Import and inherit DjangoAdminSearchFieldModelAdmin to your custom model admin class and set search_field_choices like 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_search_fields-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_admin_search_fields-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django_admin_search_fields-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ec5c7145623ece12e2b540341d7a0cd6e8a7f70caffccafb411c13a7ae0b048d
MD5 c30a8829958969e7e525e98e0dba3e90
BLAKE2b-256 295a33fa33e68410aba9054685cd58c3c52f5dd437b66b9070147b3dada2d785

See more details on using hashes here.

File details

Details for the file django_admin_search_fields-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_search_fields-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41639f4fd174d042558ebbe3cbda0f705acf2217b90eb401c742fc013d7f6dd9
MD5 ffb93935ecfb56cbfb09e3a3bde16554
BLAKE2b-256 22d23f942fc091c10a34455cb71acde9617bf2b653f390d4d9a086562f1a893f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page