File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,34 @@ Installation
2323
2424 url(r'^select2/', include('django_select2.urls')),
2525
26+ Quick Start
27+ -----------
28+
29+ Here is a quick example to get you started:
30+
31+ 0. Follow the installation instructions above.
32+
33+ 1. Add a select2 widget to the form. For example if you wanted Select2 with multi-select you would use
34+ ``Select2MultipleWidget ``
35+ Replacing::
36+
37+ class MyForm(forms.Form):
38+ things = ModelMultipleChoiceField(queryset=Thing.objects.all())
39+
40+ with::
41+
42+ class MyForm(forms.Form):
43+ things = ModelMultipleChoiceField(queryset=Thing.objects.all(), widget=Select2MultipleWidget)
44+
45+ 2. Add the CSS to the ``head `` of your Django template::
46+
47+ {{ form.media.css }}
48+
49+ 3. Add the JavaScript to the end of the ``body `` of your Django template::
50+
51+ {{ form.media.js }}
52+
53+ 4. Done - enjoy the wonders of Select2!
2654
2755External Dependencies
2856---------------------
You can’t perform that action at this time.
0 commit comments