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.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for django_admin_search_fields-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c14e3fda2d8a01339a42bb5e14ac56a7478e1f4d0f53fb9ae372b7b8bb61863c
MD5 5cdcb1b0336da94f104b087ac2af2e5d
BLAKE2b-256 93e73ce1a1be486f0b829623bb0a3a96ec859fe3e6ad2f136e5d1a0fe436121b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_search_fields-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5474e65cf504a8bc07988d36ea3ad83bd7f48ced4b411cdef7ea504d6205db36
MD5 82d7b6ec97f622e7082c4bab014da913
BLAKE2b-256 bac9e17ce976fa49764e34660496d7d35b5d41a15146ff9b93142d0edd5ccc18

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