
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
django-autocompletefilter
Advanced tools
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.
.. image:: https://pbs.twimg.com/media/DgmzYLbW4AA9oL3.jpg:large
#. Install the package, for example from PyPi::
pip install django-autocompletefilter
#. Add autocompletefilter
to your INSTALLED_APPS
setting.
#. Create and register a model admin for the model you want to filter by.
Ensure it has search_fields
specified for autocomplete to work.
#. 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),
)
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.
Currently only tested on Python 3.6
All suggestions are welcome. Especially about ways to make this cleaner.
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.
FAQs
Django ModelAdmin list_filter with autocomplete widget.
We found that django-autocompletefilter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.