Welcome to django-autocomplete-light’s documentation!¶
Features¶
Python 3.11–3.14 and Django 5.2–6.0+ support
Django (multiple) choice support,
Django (multiple) model choice support,
Django generic foreign key support (through django-querysetsequence),
Multiple widget support: native web component (
dal_alight), select2.js (dal_select2).Creating choices that don’t exist in the autocomplete,
Offering choices that depend on other fields in the form, in an elegant and innovative way,
Dynamic widget creation (ie. inlines), supports YOUR custom scripts too,
Provides a test API for your awesome autocompletes, to support YOUR custom use cases too,
A documented automatically tested example for each use case in test_project.
Compatibility¶
Warning
4.0.1 Introduced too many breaking changes from 4.0, and was re-released as 5.0.
Did I unexpectedly break your build?
Do you have an issue that may be affecting everyone’s build? I am likely to miss your issue or not catch it in time, DO TEXT ME in this kind of emergency case, I can always yank a release, if you don’t have any reply in 24h, feel free to TEXT AGAIN. My cell number has been on the yourlabs.org footer for years (TECH section) and is meant to stay. All the spamers of the world have it already so why not use it to do something useful together ? Or have a drink ofc
Use this matrix to pick the django-autocomplete-light version series for your Django version:
django-autocomplete-light |
Django |
Purpose |
Upgrade |
|---|---|---|---|
5.x |
5.2, 6.0+ |
||
4.x |
4.2, 5.2, 6.0+ |
modernization & cleanup |
|
3.12.x |
3.2 to 5.2 |
Resources¶
For Security issues, please contact security@<our github group name>.org
Basics¶
- Install
- Tutorial
- Overview
- Install
- Create an autocomplete view
- Register the view
- Use the view in a Form widget
- Using autocompletes in the admin
- Using autocompletes outside the admin
- Creation of new choices
- Filtering results based on other form fields (forwarding)
- Autocompleting from a list of strings
- Grouped results
- Tags support
- Generic Foreign Key support
- Class reference
External app support¶
Upgrading¶
Select2 frontend¶
- Frontend Comparison: alight vs select2
- Select2 Tutorial
- Overview
- Create an autocomplete view
- Register the autocomplete view
- Use the view in a Form widget
- Passing options to select2
- Using autocompletes in the admin
- Using autocompletes outside the admin
- Displaying results using custom HTML
- Displaying selected result differently than in list
- Overriding javascript code
- Listening for the initialization of a specific input
- Creation of new choices in the autocomplete form
- Filtering results based on the value of other fields in the form
- Building blocks for custom logic
- Autocompleting based on a List of Strings
- Migrating from dal_select2 to dal_alight