Skip to main content

Mixin for Django's admin objects to enhance searching by limiting searchable fields

Project description

Admin Search Plus

Admin Search Plus is a AdminMixin for Django that limits searches to specific fields which greatly enhances performance when working on large datasets.

Installation

$ pip install admin-search-plus

Or through github:

$ pip install -e git://github.com/Lenders-Cooperative/admin-search-plus#egg=admin-search-plus

Building from source

$ python -m build

$ pip install admin_search_plus.whl

Usage

  1. Add admin_search_plus to your INSTALLED_APPS before django.contrib.admin:

    INSTALLED_APPS = [
        'app_to_be_overrided',
        ...
        'admin_search_plus',
        ...
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
    ]
    

    NOTE: To override a template, the app should be listed before admin_search_plus

  2. In admin.py import AdminSearchPlusMixin to add search functions to ModelAdmin.

    from admin_search_plus import AdminSearchPlusMixin
    
    class YourModelAdmin(AdminSearchPlusMixin, admin.ModelAdmin):
        admin_search_plus = True
        show_full_result_count = False
        show_result_count = False
    
    admin.site.register(YourModel, YourModelAdmin)
    
    

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

admin-search-plus-0.3.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

admin_search_plus-0.3.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file admin-search-plus-0.3.1.tar.gz.

File metadata

  • Download URL: admin-search-plus-0.3.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.3

File hashes

Hashes for admin-search-plus-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8c6815a8203dfed00d0b06d0126453075a1e74a5958c28e8c5788702df26528b
MD5 f0ad0477012457cfb5f6eab52263d8e9
BLAKE2b-256 3ad0a9324aa65e8ad207d049b879786d28a6b3c45ec79944d27bff2dc41632cf

See more details on using hashes here.

File details

Details for the file admin_search_plus-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: admin_search_plus-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.3

File hashes

Hashes for admin_search_plus-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f26c963cadd140d44ba76a864ae982f81621f20ddea076a47215d2097d80b56
MD5 1e9cc07d76bb30e5a1fb70646b32d10a
BLAKE2b-256 71a211518c8127474ce22c2691a400c7312452d2663f7211066f49fc2ee4eadf

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