Skip to main content

django-autocompletefilter

A django application that lets you use the built in autocomplete function of the django admin to filter in admin list views by foreign key relations.

https://pbs.twimg.com/media/DgmzYLbW4AA9oL3.jpg:large

Usage

  1. Install the package, for example from PyPi:

    pip install django-autocompletefilter
  2. Add autocompletefilter to your INSTALLED_APPS setting.

  3. Create and register a model admin for the model you want to filter by. Ensure it has search_fields specified for autocomplete to work.

  4. In your second model admin, use the AutocompleteFilterMixin on your class and add the desired foreign key attribute to filter by to the list_filter items by using the AutocompleteListFilter class:

    from autocompletefilter.admin import AutocompleteFilterMixin
    from autocompletefilter.filters import AutocompleteListFilter
    
    class FooAdmin(AutocompleteFilterMixin, admin.ModelAdmin):
        list_filter = (
            ('bar', AutocompleteListFilter),
        )

Status of this project

This project is currently using a rather hacky way to implement this. Caution is advised when using it.

Using multiple autocomplete filters on the same page does work.

Tested with Django 4.2 to 6.1.

Contributing

All suggestions are welcome. Especially about ways to make this cleaner.

Common issues

  • Reverse for ‘<app_name>_<model_name>_autocomplete’ not found.

    You must register a model admin with search_fields for the model you want to look up.

  • The results could not be loaded.

    You likely forgot to specify search_fields on your model admin for the model you want to look up.

Metadata

Release files for django-autocompletefilter 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-autocompletefilter 0.1.0
File Size Uploaded Provenance Actions
django_autocompletefilter-0.1.0.tar.gz 5.6 kB With provenance Details for django_autocompletefilter-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 11.8 kB

Release files / django_autocompletefilter-0.1.0.tar.gz

Download URL django_autocompletefilter-0.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c90b3b41505c87be52c0eb346f2bb243d585a0d64c22fabe2869e51f087d00f5
BLAKE2b-256 checksum
How to use checksums
cee81cac562a5c402c35b9de5a38df3662662cce989c9ef656bfda5c0785cb87
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 31, 2026.

Transparency log

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

Download URL django_autocompletefilter-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7281d0915bd5c5f5de559b417c19f1f5ef52134bba4783ac7a9cc3efa948304d
BLAKE2b-256 checksum
How to use checksums
1a10ee9f26b5a1714cabef2f2558d34821566a3c4332661e3ce5fba40c66f684
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 31, 2026.

Transparency log

Security for django-autocompletefilter 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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_autocompletefilter-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 31, 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.

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