Mixin for Django's admin objects to enhance searching
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
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.mixins 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.2.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for admin_search_plus-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66635bc298e0cf32120a3f6fb870dd5935276cbeb8714419c352ac67ee68e65c |
|
MD5 | 7f0b09f42aba209a546cec3475d81dda |
|
BLAKE2b-256 | 708718cb8f9cd41f62bf8c0c9f51a4d856e0ac344b32140572a4e0f1d5c3a61f |