Note that there is a select field library with even more features available at https://github.com/theatlantic/django-select2-forms. Most implementation work will go towards django-select2-forms.
The recommended way to install from source is with pip:
pip install -e "git+https://github.com/theatlantic/django-chosen.git#egg=django-chosen"
If the source is already checked out, use setuptools:
python setup.py develop
or, you can install from pypi:
pip install django-chosen
django-chosen makes the following fields and widget available:
The django-chosen fields can be passed an optional kwarg
overrides the text which appears when no option is selected in the dropdown.
from django import forms from chosen import forms as chosenforms class BookForm(forms.Form): name = forms.CharField(max_length=100) quality = chosenforms.ChosenChoiceField(overlay="Select book quality...", choices=(('New', 'new'), ('Used', 'used'))) authors = chosenforms.ChosenModelMultipleChoiceField(queryset=Author.objects.all())
The django code is licensed under the
Simplified BSD License and is copyright The Atlantic
Media Company. View the
LICENSE file under the root directory for complete
license and copyright information.
MIT License. View
chosen/media/js/chosen.LICENSE.md for complete license and copyright
Chosen is a library for making long, unwieldy select boxes more user friendly.
- jQuery support: 1.4+
- Prototype support: 1.7+
For documentation, usage, and examples, see Harvest's Chosen JS github