Skip to main content

django-admin-suggest

Python tests JavaScript tests Current version on PyPI PyPI - Python Version PyPI - Django Version Downloads

Suggestions as one types, for the Django admin and django-unfold: the changelist's search box suggests the objects it finds, opens the one chosen, and offers to add what isn't found.

Install

uv add django-admin-suggest
# or
pip install django-admin-suggest

Add it to INSTALLED_APPS (so Django finds its template, and django.contrib.staticfiles its JS and CSS):

INSTALLED_APPS = [
    ...,
    "django_admin_suggest",
]

Search suggestions

The changelist's search box suggests the objects it finds as one types; choosing one, with the mouse or the keyboard (↑ ↓ Enter, Esc closes), opens its change page. Enter without choosing one searches as always.

from django.contrib import admin
from django_admin_suggest import SearchSuggestionsMixin


@admin.register(Image)
class ImageAdmin(SearchSuggestionsMixin, admin.ModelAdmin):
    search_fields = ("title", "album__title")
    search_suggestions = True
    search_suggestions_limit = 8  # optional (8)
    search_suggestions_min_length = 2  # optional (2)
    search_suggestions_add = True  # optional: nothing found, "+ Add “…”"

    def get_search_suggestion_label(self, request, obj):  # optional
        return f"{obj.title} · {obj.album}"
  • The suggestions are what the changelist's search finds: its get_search_results() (search_fields, their ^, = and @ prefixes, and whatever overrides it), on get_queryset(request), in the changelist's order, each object once.
  • What it costs: one query, of search_suggestions_limit objects at most, a fraction of a second after the typing stops (an older request is cancelled). Use list_select_related or get_queryset() if the label reads a relation.
  • Only for those who may view or change the objects; each suggestion leads to its change page (read-only, for those who may only view it). get_search_suggestion_url() changes where (None: not suggested), and get_search_suggestions(request, term) which objects.
  • With search_suggestions_add, when nothing is found the last option is "+ Add “what was typed”": the add page, with it in a field — True: the first of search_fields that is an editable field of the model ("^title" or "title__iexact" count as title; none: the add page empty), or the field's name (search_suggestions_add = "title"). Only for those who may add; get_search_suggestion_add_url(request, term) changes where it leads (None: not offered).
  • It looks like the admin's autocomplete fields: Select2's dropdown, on the admin's own stylesheets (and Unfold's), light and dark. The search box stays a text box: no jQuery, nor Select2's script.
  • An accessible combobox (ARIA), without inline scripts (it works under a strict Content Security Policy). Not in a popup (where choosing an object picks it for a field).

The search box of the images, with "snow" typed and three images suggested

The same, in Unfold

With search_suggestions_add, when nothing is found:

The search box with "Lighthouse" typed: nothing found, and "+ Add “Lighthouse”" highlighted

The same, in Unfold

With other packages

The changelist keeps the template the admin would use: it's rendered with django_admin_suggest/change_list.html, which extends it (change_list_template, Unfold's, or another package's such as django-admin-tables) and only adds the script's configuration to extrahead.

Translations

Ships a Spanish (es) translation.

Supported versions

Django 4.2 – 6.1, Python 3.10+.

Development

See CONTRIBUTING.md for setup, running the example project, and the test/lint/type-check commands.

Metadata

Release files for django-admin-suggest 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-suggest 0.1.0
File Size Uploaded Provenance Actions
django_admin_suggest-0.1.0.tar.gz 293.7 kB With provenance Details for django_admin_suggest-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-suggest 0.1.0
File Interpreter ABI Platform Actions
django_admin_suggest-0.1.0-py3-none-any.whl Python 3 none any Details for django_admin_suggest-0.1.0-py3-none-any.whl

Total release size: 307.4 kB

Release files / django_admin_suggest-0.1.0.tar.gz

Download URL django_admin_suggest-0.1.0.tar.gz
Size 293.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8a7d7f05aaa838484ca9553a34e441f97a33cc369c2386d81e4b15fc01089235
BLAKE2b-256 checksum
How to use checksums
99674de6e6cacd121eea4c267baf94efa63631cd6035e16c475caf7c7b996a07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / django_admin_suggest-0.1.0-py3-none-any.whl

Download URL django_admin_suggest-0.1.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23edf675971b36fcbe4fdfc7060048b14c083f4cbf60e7d3a7a3eda5e1561625
BLAKE2b-256 checksum
How to use checksums
6479c4f7cf4df1fc27e4cddb339a98d2635895622d41cd5e9a9beee12b50fe3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for django-admin-suggest 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_admin_suggest-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page