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
-
Add
admin_search_plus
to yourINSTALLED_APPS
beforedjango.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
-
In
admin.py
importAdminSearchPlusMixin
to add search functions toModelAdmin
.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
Built Distribution
Hashes for admin_search_plus-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f26c963cadd140d44ba76a864ae982f81621f20ddea076a47215d2097d80b56 |
|
MD5 | 1e9cc07d76bb30e5a1fb70646b32d10a |
|
BLAKE2b-256 | 71a211518c8127474ce22c2691a400c7312452d2663f7211066f49fc2ee4eadf |