Welcome to django-autocomplete-light’s documentation!¶
django-autocomplete-light’s purpose is to enable autocompletes quickly and properly in a django project: it is the fruit of half a decade of R&D and thousands of contributions. It was designed for Django so that every part overridable or reusable independently. It is stable, tested, documented and fully supported: it tries to be a good neighbour in Django ecosystem.
- charfield, foreign key, many to many autocomplete widgets,
- generic foreign key, generic many to many autocomplete widgets,
- django template engine support for autocompletes, enabling you to include images etc ...
- add-another popup supported outside the admin too.
- keyboard is supported with enter, tab and arrows by default.
- Django 1.8, Python3 support
Each feature has a live example and is fully documented. It is also designed and documented so that you create your own awesome features too.
- **Documentation** graciously hosted by RTFD
- Live demo graciously hosted by PythonAnywhere,
- Video demo graciously hosted by Youtube,
- Mailing list graciously hosted by Google
- Git graciously hosted by GitHub,
- Package graciously hosted by PyPi,
- Continuous integration graciously hosted by Travis-ci
- **Online paid support** provided via HackHands,
Quick evaluation of DAL in a temporary local environment¶
While you can use the live demo hosted by PythonAnywhere, you can run test projects for a local demo in a temporary virtualenv.
Installation instructions for DAL¶
Advanced Django users are likely to install it in no time by following this step-list. Click on a step for details.
- Install the
django-autocomplete-light>=2.0.0prepackage with pip
- Django < 1.7 support: call
- Ensure you understand
autocomplete_light/static.htmlafter loading jquery.js (>=1.7)
- Optionally include it in
If you didn’t click any, and this is your first install: bravo !
Enabling autocompletes inside and outside of the admin has become piece of cake.
Reference and design documentation¶
If you need anything more than just enabling autocompletes in the admin, then you should understand django-autocomplete-light’s architecture. Because you can override any part of it.
The architecture is based on 3 main parts which you can override to build insanely creative features as many users already did.
- Autocomplete classes
- Design documentation
- Form, fields and widgets
- Design documentation
- Voodoo black magic
Using just the concepts you’ve learned in the reference, here are some of the things you can do.
- Can’t see admin add-another
+button when overriding a
- RemovedInDjango18Warning: Creating a ModelForm without either the ‘fields’ attribute or the ‘exclude’ attribute is deprecated - form YourForm needs updating
- How to run tests
- Why not use Widget.Media ?
- Model field’s
verbose_nameare lost when overriding the widget
- Fields bound on values which are not in the queryset anymore raise a ValidationError
- How to override a JS method ?
- How to work around Django bug #9321: Hold down “Control” ... ?
- How to report a bug effectively ?
- How to ask for help ?
Any change is documented in the Change log for django-autocomplete-light, so upgrading from a version
to another is always documented there. Usualy, upgrade from pip with a command
pip install -U django-autocomplete-light. Check the CHANGELOG for BC
(Backward Compatibility) breaks. There should is no backward compatibility for
minor version upgrades ie. from 1.1.3 to 1.1.22, but there might be some
minor BC breaks for middle upgrades ie. 1.2.0 to 1.3.0.
v1 to v2¶
There are major changes between v1 and v2, upgrading has been extensively documented:
- Upgrading from django-autocomplete-light v1 to v2
- Quick upgrade
- Detailed upgrade
- You should not use widget directly anymore
- Specification of the Autocomplete class to use
- Python class re-organisation
- Deprecation of
max-valueswas renamed to
data-autocomplete-placeholderis gone in favor of HTML5
- Widget template changes
- Script changes