Skip to main content

Simple django app that add autocomplete to search inside admin panel.

Project description

Simple django app that add autocomplete to search inside admin panel.

https://raw.githubusercontent.com/linevych/django-search-admin-autocomplete/master/doc/demo.gif

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

django-search-admin-autocomplete-0.2.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-search-admin-autocomplete-0.2.1.tar.gz.

File metadata

  • Download URL: django-search-admin-autocomplete-0.2.1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for django-search-admin-autocomplete-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3dec18da377b210e6eb45173eb9681bfd74b3d04864289cdd39e2f35922521cf
MD5 7fb08d32ba69b0d7101e234d2e0cefe4
BLAKE2b-256 e27ef99583564cff32b63baf1e0cefb87b154e1658dd6c46613a4174576ec695

See more details on using hashes here.

File details

Details for the file django_search_admin_autocomplete-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_search_admin_autocomplete-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for django_search_admin_autocomplete-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e81fceb17b98b88c26961ba458595d805551073a08df68f074735c9cd7cde19
MD5 290d8c30098cfbf5a61d9d7f19c51172
BLAKE2b-256 6d71e229a7549c7521b3f7eab2d9d498fa72148917c0dbd1d27123f7b07045f5

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