Skip to main content

Django admin list view search autocomplete with related field support

Project description

Django Listview Search Admin Autocomplete

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

This is a fork of django-search-admin-autocomplete (archived). The original package is no longer maintained. This fork adds new features, modern Django support, and bug fixes.

Simple Django app that adds autocomplete search to the admin panel changelist view.

What’s New

  • Related field search: Search across ForeignKey relations (e.g., client__name, category__title)

  • Django 4+ / 5+ support: Fixed deprecated url() imports

  • Modern build system: pyproject.toml with hatchling (no more setup.py)

  • Python 3.8–3.13 support

  • Comprehensive test suite (18 tests)

Requirements

  • Python: 3.8+

  • Django: 3.2+

Installation

pip install django-listview-search-admin-autocomplete
INSTALLED_APPS = [
    ...
    'search_admin_autocomplete',
    ...
]

Usage

Basic usage with direct fields:

from search_admin_autocomplete.admin import SearchAutoCompleteAdmin

class MyModelAdmin(SearchAutoCompleteAdmin):
    search_fields = ['name', 'description']

admin.site.register(MyModel, MyModelAdmin)

Configuration Options

class MyModelAdmin(SearchAutoCompleteAdmin):
    search_fields = ['name', 'client__name']
    search_prefix = '__icontains'  # Search operator (default: '__contains')
    max_results = 20               # Max autocomplete results (default: 10)

Customization

If you have a custom change_list.html:

admin.py

from search_admin_autocomplete.admin import SearchAutoCompleteAdmin

class MyModelAdmin(SearchAutoCompleteAdmin):
    change_list_template = 'admin/custom-list.html'
    search_fields = ['name', 'client__title']

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 %}

Running Tests

cd example
python manage.py test search_admin_autocomplete

Changelog

1.0.0 (2026)

  • Forked from archived django-search-admin-autocomplete

  • Added support for related field lookups (e.g., client__name)

  • Updated for Django 4+ and 5+ compatibility

  • Modernized package configuration with pyproject.toml

  • Added comprehensive test suite (18 tests)

  • Production-ready release

0.2.1 and earlier

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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_listview_search_admin_autocomplete-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django_listview_search_admin_autocomplete-1.0.0.tar.gz
Algorithm Hash digest
SHA256 592a51698837a1d8306e4afb91394d779cfebf9e4788873162ed46e21ff10ec2
MD5 4673a76f5fdf1d72f589abfabe283b68
BLAKE2b-256 24f265c93e240ccf040f4ef8cf04b544c1ef34a1e8f7e6d825e76fed9b2edad0

See more details on using hashes here.

File details

Details for the file django_listview_search_admin_autocomplete-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_listview_search_admin_autocomplete-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3f05eb495f9aa72688d633e1343bf060f0bb8dd4338c76105b277b0e1fd1acf
MD5 f30a5d4f5627109c2e95e0b86c7c4cc9
BLAKE2b-256 2cb41efa1d46163364c38f7dfc2d89f8916999efc26c0139a3d6298abce81be0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page