Simple django app that add autocomplete to search inside admin panel.
Project description
Simple django app that add autocomplete to search inside admin panel.
Requirements
Python: 3.5+
Django: >=1.11
Installation
pip install django-search-admin-autocomplete
# OR
pip install git+https://github.com/linevych/django-search-admin-autocomplete.git
INSTALLED_APPS = [
...
'search_admin_autocomplete',
...
]
Usage
from search_admin_autocomplete.admin import SearchAutoCompleteAdmin
class MyModelAdmin(SearchAutoCompleteAdmin)
search_fields = ['search_field', ]
admin.site.register(MyModel, MyModelAdmin)
Customization
If admin/change_list.html is customized
admin.py
from search_admin_autocomplete.admin import SearchAutoCompleteAdmin
class MyModelAdmin(SearchAutoCompleteAdmin)
change_list_template = 'admin/custom-list.html'
search_fields = ['search_field', ]
admin.site.register(MyModel, MyModelAdmin)
admin/custom-list.html
{% extends 'search_admin_autocomplete/change_list.html' %}
{% block object-tools %}
Your custom html...
{{ block.super }}
{% endblock %}
MyPy
This project supports MyPy but to run type checks you need Python 3.6+.
pip install -r requirements_dev.txt
PYTHONPATH="$PYTHONPATH:$PWD/example" mypy search_admin_autocomplete
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
Close
Hashes for django-search-admin-autocomplete-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dec18da377b210e6eb45173eb9681bfd74b3d04864289cdd39e2f35922521cf |
|
MD5 | 7fb08d32ba69b0d7101e234d2e0cefe4 |
|
BLAKE2b-256 | e27ef99583564cff32b63baf1e0cefb87b154e1658dd6c46613a4174576ec695 |
Close
Hashes for django_search_admin_autocomplete-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e81fceb17b98b88c26961ba458595d805551073a08df68f074735c9cd7cde19 |
|
MD5 | 290d8c30098cfbf5a61d9d7f19c51172 |
|
BLAKE2b-256 | 6d71e229a7549c7521b3f7eab2d9d498fa72148917c0dbd1d27123f7b07045f5 |