Added AUTO_RENDER_SELECT2_STATICS setting.

This commit is contained in:
AppleGrew (applegrew) 2012-09-14 12:04:36 +05:30
parent 18856a8e1a
commit 6409289bbb
56 changed files with 708 additions and 167 deletions

View file

@ -48,6 +48,11 @@ Special Thanks
Changelog Summary
=================
### v3.0.2
* Added `AUTO_RENDER_SELECT2_STATICS` settings. This, when specified and set to `False` in `settings.py` then Django_Select2 widgets won't automatically include the required scripts and stylesheets. When this setting is `True` (default) then every Select2 field on the page will output `<script>` and `<link>` tags to include the required JS and CSS files. This is convinient but will output the same JS and CSS files multiple times if there are more than one Select2 fields on the page.
* Added `django_select2_tags` template tags to manually include the required JS and CSS files, when `AUTO_RENDER_SELECT2_STATICS` is turned off.
### v3.0.1
* Revised the design of heavy fields. The previous design didn't quite make it easy to back heavy fields by big data sources. See `fields.HeavyChoiceField` class and its methods' docs for more info.

View file

@ -74,14 +74,20 @@ The view - `Select2View`, exposed here is meant to be used with 'Heavy' fields a
"""
__version__ = "3.0.1"
__version__ = "3.0.2"
__RENDER_SELECT2_STATICS = False
from django.conf import settings
if settings.configured:
from .widgets import Select2Widget, Select2MultipleWidget, HeavySelect2Widget, HeavySelect2MultipleWidget, \
AutoHeavySelect2Widget, AutoHeavySelect2MultipleWidget
from .fields import Select2ChoiceField, Select2MultipleChoiceField, HeavySelect2ChoiceField, \
HeavySelect2MultipleChoiceField, HeavyModelSelect2ChoiceField, HeavyModelSelect2MultipleChoiceField, \
ModelSelect2Field, ModelSelect2MultipleField, AutoSelect2Field, AutoSelect2MultipleField, \
AutoModelSelect2Field, AutoModelSelect2MultipleField
from .views import Select2View, NO_ERR_RESP
__RENDER_SELECT2_STATICS = getattr(settings, 'AUTO_RENDER_SELECT2_STATICS', True)
from .widgets import Select2Widget, Select2MultipleWidget, HeavySelect2Widget, HeavySelect2MultipleWidget, \
AutoHeavySelect2Widget, AutoHeavySelect2MultipleWidget
from .fields import Select2ChoiceField, Select2MultipleChoiceField, HeavySelect2ChoiceField, \
HeavySelect2MultipleChoiceField, HeavyModelSelect2ChoiceField, HeavyModelSelect2MultipleChoiceField, \
ModelSelect2Field, ModelSelect2MultipleField, AutoSelect2Field, AutoSelect2MultipleField, \
AutoModelSelect2Field, AutoModelSelect2MultipleField
from .views import Select2View, NO_ERR_RESP

View file

View file

@ -0,0 +1,20 @@
from django import template
from django.conf import settings
register = template.Library()
from ..widgets import HeavySelect2Widget
__proxy_widget = HeavySelect2Widget(data_view="xyz")
@register.simple_tag(name='import_django_select2_js')
def import_js():
return u'\n'.join(__proxy_widget.media.render_js())
@register.simple_tag(name='import_django_select2_css')
def import_css():
return u'\n'.join(__proxy_widget.media.render_css())
@register.simple_tag(name='import_django_select2_js_css')
def import_all():
return __proxy_widget.media.render()

View file

@ -0,0 +1,126 @@
from django import template
from django.conf import settings
register = template.Library()
class ToolbarBtn(object):
text = ''
_btn_type = 'normal'
btn_type = property(lambda s: s._btn_type)
@btn_type.setter
def btn_type(self, val):
if val not in ['normal', 'warn', 'info', 'success', 'primary', 'inverse', 'danger']:
raise ValueError('Invalid btn_type %s' % str(val))
self._btn_type = val
action = ''
is_js_function_name = False # if True the action is JS function name,
# which will be registered as click handler of the button,
# else action is a url to invoke.
def __init__(self, text, action, is_js_function_name=False, btn_type='normal'):
self.text = text
self.action = action
self.is_js_function_name = is_js_function_name
self.btn_type = btn_type
def get_css_classes(self):
if self.btn_type == 'warn':
return 'btn-warning'
elif self.btn_type == 'info':
return 'btn-info'
elif self.btn_type == 'success':
return 'btn-success'
elif self.btn_type == 'primary':
return 'btn-primary'
elif self.btn_type == 'inverse':
return 'btn-inverse'
elif self.btn_type == 'danger':
return 'btn-danger'
return ''
def additional_attrs(self):
return 'js_click="%s"' % self.action if self.is_js_function_name else ''
def get_href(self):
return '#' if self.is_js_function_name else self.action
def get_text(self):
return self.text
def as_html(self):
return "<a class='btn %s' href='%s' %s>%s</a>" % (self.get_css_classes(), self.get_href(),
self.additional_attrs(), self.get_text())
class ToolbarDropdownBtn(ToolbarBtn):
action = '#' # Should always be #
texts_actions = []
def __init__(self, text, texts_actions, is_js_function_name=False, btn_type='normal'):
self.text = text
self.action = "#"
self.is_js_function_name = is_js_function_name
self.btn_type = btn_type
self.texts_actions = texts_actions
def get_css_classes(self):
return super(ToolbarDropdownBtn, self).get_css_classes() + ' dropdown-toggle'
def additional_attrs(self):
return 'data-toggle="dropdown"'
def get_text(self):
return self.text + '<span class="caret"></span>'
def as_html(self):
html = ("""
<div class="btn-group">
%s
<ul class="dropdown-menu">
"""
%
super(ToolbarDropdownBtn, self).as_html())
for text, action in self.texts_actions:
html += "<li><a href='%s' %s>%s</a></li>" % ('#' if self.is_js_function_name else action,
'js_click="%s"' % action if self.is_js_function_name else '', text)
html += """
</ul>
</div>"""
return html
class ToolbarNode(template.Node):
def get_list_html(self, val):
html = ''
for e in val:
if isinstance(e, ToolbarBtn):
html += e.as_html()
elif isinstance(e, list):
html += '<div class="btn-group">%s</div>' % self.get_list_html(e)
else:
ValueError('Invalid item %s in the list.' % str(e))
return html
def __init__(self, valName):
self.valName = valName
def render(self, context):
val = context[self.valName]
if val:
return '<div class="btn-group">%s</div>' % self.get_list_html(val)
else:
return ''
@register.tag(name="render_toolbar_btns")
def do_render_toolbar_btns(parser, token):
try:
# split_contents() knows not to split quoted strings.
tag_name, valName = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError("%r tag requires a single argument" % token.contents.split()[0])
return ToolbarNode(valName)

View file

@ -14,6 +14,8 @@ from django.utils.datastructures import MultiValueDict, MergeDict
from .util import render_js_script, convert_to_js_string_arr, JSVar, JSFunction, JSFunctionInContext, \
convert_dict_to_js_map, convert_to_js_arr
from . import __RENDER_SELECT2_STATICS as RENDER_SELECT2_STATICS
logger = logging.getLogger(__name__)
def get_select2_js_path():
@ -183,7 +185,8 @@ class Select2Mixin(object):
if choices: args.append(choices)
s = unicode(super(Select2Mixin, self).render(*args)) # Thanks to @ouhouhsami Issue#1
s += self.media.render()
if RENDER_SELECT2_STATICS:
s += self.media.render()
final_attrs = self.build_attrs(attrs)
id_ = final_attrs.get('id', None)
s += self.render_js_code(id_, name, value, attrs, choices)

Binary file not shown.

BIN
docs/_build/doctrees/get_started.doctree vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8c95da160e0b1c278a4616ab2a21369b
config: 9a53622bde4b07960c0159241af7199b
tags: fbb0d17656682115ca4d033fb2f83ba1

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -0,0 +1,7 @@
<map id="inheritancea008ca3d81" name="inheritancea008ca3d81">
<area shape="poly" id="node1" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="840,353,831,348,805,343,764,340,712,337,655,336,597,337,545,340,504,343,478,348,469,353,478,359,504,363,545,367,597,369,655,370,712,369,764,367,805,363,831,359"/>
<area shape="poly" id="node14" href="#django_select2.fields.AutoModelSelect2MultipleField" title="AutoModelSelect2MultipleField" alt="" coords="497,436,489,431,468,426,435,422,393,420,347,419,300,420,259,422,225,426,204,431,197,436,204,441,225,446,259,450,300,452,347,453,393,452,435,450,468,446,489,441"/>
<area shape="poly" id="node2" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="648,271,641,265,621,261,591,257,552,255,509,254,467,255,428,257,397,261,378,265,371,271,378,276,397,281,428,284,467,287,509,288,552,287,591,284,621,281,641,276"/>
<area shape="poly" id="node11" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="224,353,219,348,203,343,179,340,148,337,115,336,81,337,50,340,26,343,11,348,5,353,11,359,26,363,50,367,81,369,115,370,148,369,179,367,203,363,219,359"/>
<area shape="poly" id="node16" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="445,353,440,348,426,343,404,340,377,337,347,336,316,337,289,340,267,343,253,348,249,353,253,359,267,363,289,367,316,369,347,370,377,369,404,367,426,363,440,359"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -0,0 +1,5 @@
<map id="inheritance39128e562c" name="inheritance39128e562c">
<area shape="poly" id="node1" href="#django_select2.util.JSFunctionInContext" title="JSFunctionInContext" alt="" coords="212,105,207,100,192,95,169,92,140,89,108,88,76,89,47,92,24,95,9,100,4,105,9,111,24,115,47,119,76,121,108,122,140,121,169,119,192,115,207,111"/>
<area shape="poly" id="node2" href="#django_select2.util.JSVar" title="JSVar" alt="" coords="241,23,239,17,234,13,225,9,215,7,203,6,191,7,180,9,171,13,166,17,164,23,166,28,171,33,180,36,191,39,203,40,215,39,225,36,234,33,239,28"/>
<area shape="poly" id="node4" href="#django_select2.util.JSFunction" title="JSFunction" alt="" coords="359,105,356,100,347,95,333,92,316,89,297,88,278,89,261,92,248,95,239,100,236,105,239,111,248,115,261,119,278,121,297,122,316,121,333,119,347,115,356,111"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -0,0 +1,4 @@
<map id="inheritance2f6096d7d4" name="inheritance2f6096d7d4">
<area shape="poly" id="node15" href="#django_select2.fields.ModelSelect2Field" title="ModelSelect2Field" alt="" coords="195,271,191,265,177,261,156,257,129,255,100,254,71,255,44,257,23,261,9,265,5,271,9,276,23,281,44,284,71,287,100,288,129,287,156,284,177,281,191,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.ModelSelect2MultipleField" title="ModelSelect2MultipleField" alt="" coords="474,353,468,348,450,343,421,340,385,337,345,336,305,337,269,340,241,343,222,348,216,353,222,359,241,363,269,367,305,369,345,370,385,369,421,367,450,363,468,359"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,4 @@
<map id="inheritance25da809ef3" name="inheritance25da809ef3">
<area shape="poly" id="node4" href="#django_select2.fields.Select2ChoiceField" title="Select2ChoiceField" alt="" coords="203,188,198,183,184,178,162,174,135,172,104,171,73,172,46,174,24,178,10,183,5,188,10,193,24,198,46,202,73,204,104,205,135,204,162,202,184,198,198,193"/>
<area shape="poly" id="node6" href="#django_select2.fields.Select2MultipleChoiceField" title="Select2MultipleChoiceField" alt="" coords="460,271,453,265,434,261,405,257,368,255,327,254,286,255,249,257,219,261,200,265,194,271,200,276,219,281,249,284,286,287,327,288,368,287,405,284,434,281,453,276"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,5 @@
<map id="inheritanceb5a6c91e22" name="inheritanceb5a6c91e22">
<area shape="poly" id="node3" href="#django_select2.views.Select2View" title="Select2View" alt="" coords="190,105,187,100,177,95,162,92,143,89,121,88,100,89,81,92,66,95,56,100,53,105,56,111,66,115,81,119,100,121,121,122,143,121,162,119,177,115,187,111"/>
<area shape="poly" id="node2" href="#django_select2.views.JSONResponseMixin" title="JSONResponseMixin" alt="" coords="304,23,299,17,284,13,262,9,234,7,203,6,171,7,143,9,121,13,107,17,102,23,107,28,121,33,143,36,171,39,203,40,234,39,262,36,284,33,299,28"/>
<area shape="poly" id="node6" href="#django_select2.views.AutoResponseView" title="AutoResponseView" alt="" coords="221,188,216,183,202,178,180,174,152,172,121,171,90,172,63,174,40,178,26,183,21,188,26,193,40,198,63,202,90,204,121,205,152,204,180,202,202,198,216,193"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -0,0 +1,7 @@
<map id="inheritance0bde21cdb9" name="inheritance0bde21cdb9">
<area shape="poly" id="node4" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="772,271,764,265,743,261,709,257,667,255,620,254,573,255,531,257,497,261,476,265,468,271,476,276,497,281,531,284,573,287,620,288,667,287,709,284,743,281,764,276"/>
<area shape="poly" id="node14" href="#django_select2.fields.AutoModelSelect2Field" title="AutoModelSelect2Field" alt="" coords="463,353,457,348,440,343,415,340,383,337,347,336,311,337,279,340,253,343,236,348,231,353,236,359,253,363,279,367,311,369,347,370,383,369,415,367,440,363,457,359"/>
<area shape="poly" id="node5" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="631,188,624,183,604,178,573,174,535,172,492,171,449,172,411,174,380,178,360,183,353,188,360,193,380,198,411,202,449,204,492,205,535,204,573,202,604,198,624,193"/>
<area shape="poly" id="node11" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="224,271,219,265,203,261,179,257,148,255,115,254,81,255,50,257,26,261,11,265,5,271,11,276,26,281,50,284,81,287,115,288,148,287,179,284,203,281,219,276"/>
<area shape="poly" id="node16" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="445,271,440,265,426,261,404,257,377,255,347,254,316,255,289,257,267,261,253,265,249,271,253,276,267,281,289,284,316,287,347,288,377,287,404,284,426,281,440,276"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -0,0 +1,12 @@
<map id="inheritancecdbd4d640c" name="inheritancecdbd4d640c">
<area shape="poly" id="node1" href="#django_select2.widgets.Select2MultipleWidget" title="Select2MultipleWidget" alt="" coords="630,271,625,265,609,261,584,257,552,255,517,254,482,255,451,257,426,261,410,265,404,271,410,276,426,281,451,284,482,287,517,288,552,287,584,284,609,281,625,276"/>
<area shape="poly" id="node2" href="#django_select2.widgets.Select2Mixin" title="Select2Mixin" alt="" coords="354,188,350,183,340,178,325,174,306,172,284,171,262,172,243,174,228,178,218,183,214,188,218,193,228,198,243,202,262,204,284,205,306,204,325,202,340,198,350,193"/>
<area shape="poly" id="node7" href="#django_select2.widgets.HeavySelect2Mixin" title="HeavySelect2Mixin" alt="" coords="380,271,375,265,362,261,341,257,314,255,284,254,254,255,227,257,206,261,193,265,188,271,193,276,206,281,227,284,254,287,284,288,314,287,341,284,362,281,375,276"/>
<area shape="poly" id="node21" href="#django_select2.widgets.Select2Widget" title="Select2Widget" alt="" coords="163,271,159,265,148,261,131,257,108,255,84,254,60,255,37,257,20,261,9,265,5,271,9,276,20,281,37,284,60,287,84,288,108,287,131,284,148,281,159,276"/>
<area shape="poly" id="node6" href="#django_select2.widgets.HeavySelect2Widget" title="HeavySelect2Widget" alt="" coords="994,353,988,348,973,343,950,340,921,337,888,336,855,337,826,340,803,343,788,348,782,353,788,359,803,363,826,367,855,369,888,370,921,369,950,367,973,363,988,359"/>
<area shape="poly" id="node31" href="#django_select2.widgets.AutoHeavySelect2Widget" title="AutoHeavySelect2Widget" alt="" coords="960,436,953,431,936,426,908,422,872,420,833,419,794,420,759,422,731,426,713,431,707,436,713,441,731,446,759,450,794,452,833,453,872,452,908,450,936,446,953,441"/>
<area shape="poly" id="node14" href="#django_select2.widgets.HeavySelect2MultipleWidget" title="HeavySelect2MultipleWidget" alt="" coords="501,353,494,348,474,343,443,340,404,337,361,336,318,337,279,340,248,343,229,348,222,353,229,359,248,363,279,367,318,369,361,370,404,369,443,367,474,363,494,359"/>
<area shape="poly" id="node19" href="#django_select2.widgets.MultipleSelect2HiddenInput" title="MultipleSelect2HiddenInput" alt="" coords="927,271,921,265,901,261,871,257,833,255,791,254,748,255,710,257,680,261,661,265,654,271,661,276,680,281,710,284,748,287,791,288,833,287,871,284,901,281,921,276"/>
<area shape="poly" id="node11" href="#django_select2.widgets.AutoHeavySelect2MultipleWidget" title="AutoHeavySelect2MultipleWidget" alt="" coords="630,436,622,431,599,426,564,422,519,420,469,419,420,420,375,422,340,426,317,431,309,436,317,441,340,446,375,450,420,452,469,453,519,452,564,450,599,446,622,441"/>
<area shape="poly" id="node12" href="#django_select2.widgets.AutoHeavySelect2Mixin" title="AutoHeavySelect2Mixin" alt="" coords="758,353,753,348,736,343,710,340,677,337,641,336,605,337,573,340,547,343,530,348,524,353,530,359,547,363,573,367,605,369,641,370,677,369,710,367,736,363,753,359"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -0,0 +1,5 @@
<map id="inheritance4f5879fafb" name="inheritance4f5879fafb">
<area shape="poly" id="node9" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="454,271,447,265,425,261,392,257,350,255,303,254,256,255,213,257,180,261,158,265,151,271,158,276,180,281,213,284,256,287,303,288,350,287,392,284,425,281,447,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="544,353,535,348,509,343,468,340,416,337,359,336,301,337,249,340,208,343,182,348,173,353,182,359,208,363,249,367,301,369,359,370,416,369,468,367,509,363,535,359"/>
<area shape="poly" id="node5" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="281,188,274,183,255,178,224,174,185,172,143,171,100,172,61,174,31,178,11,183,4,188,11,193,31,198,61,202,100,204,143,205,185,204,224,202,255,198,274,193"/>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -0,0 +1,11 @@
<map id="inheritanceea81e519c1" name="inheritanceea81e519c1">
<area shape="poly" id="node1" href="#django_select2.fields.AutoSelect2MultipleField" title="AutoSelect2MultipleField" alt="" coords="434,353,428,348,411,343,383,340,349,337,311,336,273,337,238,340,211,343,193,348,187,353,193,359,211,363,238,367,273,369,311,370,349,369,383,367,411,363,428,359"/>
<area shape="poly" id="node2" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="543,271,539,265,525,261,503,257,476,255,445,254,415,255,388,257,366,261,352,265,347,271,352,276,366,281,388,284,415,287,445,288,476,287,503,284,525,281,539,276"/>
<area shape="poly" id="node15" href="#django_select2.fields.AutoSelect2Field" title="AutoSelect2Field" alt="" coords="659,353,655,348,642,343,622,340,597,337,569,336,542,337,517,340,497,343,484,348,480,353,484,359,497,363,517,367,542,369,569,370,597,369,622,367,642,363,655,359"/>
<area shape="poly" id="node4" href="#django_select2.fields.HeavySelect2MultipleChoiceField" title="HeavySelect2MultipleChoiceField" alt="" coords="323,271,316,265,293,261,258,257,213,255,164,254,115,255,70,257,35,261,12,265,5,271,12,276,35,281,70,284,115,287,164,288,213,287,258,284,293,281,316,276"/>
<area shape="poly" id="node6" href="#django_select2.fields.ChoiceMixin" title="ChoiceMixin" alt="" coords="408,23,405,17,395,13,381,9,362,7,341,6,321,7,302,9,287,13,278,17,274,23,278,28,287,33,302,36,321,39,341,40,362,39,381,36,395,33,405,28"/>
<area shape="poly" id="node12" href="#django_select2.fields.HeavyChoiceField" title="HeavyChoiceField" alt="" coords="496,105,492,100,479,95,458,92,433,89,404,88,375,89,350,92,329,95,316,100,312,105,316,111,329,115,350,119,375,121,404,122,433,121,458,119,479,115,492,111"/>
<area shape="poly" id="node8" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="632,188,625,183,605,178,575,174,536,172,493,171,451,172,412,174,381,178,362,183,355,188,362,193,381,198,412,202,451,204,493,205,536,204,575,202,605,198,625,193"/>
<area shape="poly" id="node17" href="#django_select2.fields.HeavySelect2ChoiceField" title="HeavySelect2ChoiceField" alt="" coords="819,271,813,265,795,261,767,257,732,255,693,254,655,255,620,257,592,261,574,265,568,271,574,276,592,281,620,284,655,287,693,288,732,287,767,284,795,281,813,276"/>
<area shape="poly" id="node10" href="#django_select2.fields.HeavyMultipleChoiceField" title="HeavyMultipleChoiceField" alt="" coords="298,188,292,183,274,178,246,174,211,172,172,171,133,172,98,174,70,178,52,183,46,188,52,193,70,198,98,202,133,204,172,205,211,204,246,202,274,198,292,193"/>
</map>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>django_select2.fields &mdash; Django-Select2 3.0.1 documentation</title>
<title>django_select2.fields &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="../../index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
@ -725,7 +725,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>django_select2.util &mdash; Django-Select2 3.0.1 documentation</title>
<title>django_select2.util &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="../../index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
@ -353,7 +353,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>django_select2.views &mdash; Django-Select2 3.0.1 documentation</title>
<title>django_select2.views &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="../../index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
@ -270,7 +270,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>django_select2.widgets &mdash; Django-Select2 3.0.1 documentation</title>
<title>django_select2.widgets &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="../../index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
@ -592,7 +592,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &mdash; Django-Select2 3.0.1 documentation</title>
<title>Overview: module code &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="../index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="../index.html" />
</head>
<body>
<div class="related">
@ -36,7 +36,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -83,7 +83,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="../index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

View file

@ -0,0 +1,49 @@
===========
Get Started
===========
Overview
--------
.. automodule:: django_select2
:members:
Installation
------------
1. Install `django_select2`::
pip install django_select2
2. Add `django_select2` to your `INSTALLED_APPS` in your project settings.
3. When deploying on production server, run::
python manage.py collectstatic
Available Setting
-----------------
``AUTO_RENDER_SELECT2_STATICS`` [Default ``True``]
This, when specified and set to ``False`` in ``settings.py`` then Django_Select2 widgets won't automatically include the required scripts and stylesheets. When this setting is ``True`` then every Select2 field on the page will output ``<script>`` and ``<link>`` tags to include the required JS and CSS files. This is convinient but will output the same JS and CSS files multiple times if there are more than one Select2 fields on the page.
When this settings is ``False`` then you are responsible for including the JS and CSS files. To help you with this the following template tags are available in ``django_select2_tags``.
* ``import_django_select2_js`` - Outputs ``<script>`` tags to include all the JS files, required by Light and Heavy widgets.
* ``import_django_select2_css`` - Outputs ``<link>`` tags to include all the CSS files, required by Light and Heavy widgets.
* ``import_django_select2_js_css`` - Outputs both ``<script>`` and ``<link>`` tags to include all the JS and CSS files, required by Light and Heavy widgets.
Make sure to include them at the top of the page, prefereably in ``<head>...</head>``.
External Dependencies
---------------------
* Django - This is obvious.
* jQuery - This is not included in the package since it is expected that in most scenarios this would already be available. The above template tags also won't out ``<script>`` tag to include this. You need to do this yourself.
Example Application
-------------------
Please see ``testapp`` application. This application is used to manually test the functionalities of this package. This also serves as a good example.
You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.

View file

@ -10,7 +10,7 @@ Contents:
.. toctree::
overview
get_started
reference
Indices and tables

View file

@ -9,7 +9,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; Django-Select2 3.0.1 documentation</title>
<title>Index &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -17,7 +17,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
</head>
<body>
<div class="related">
@ -38,7 +38,7 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -189,7 +189,7 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="overview.html#module-django_select2">django_select2 (module)</a>
<dt><a href="get_started.html#module-django_select2">django_select2 (module)</a>
</dt>
@ -643,7 +643,7 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

229
docs/_build/html/get_started.html vendored Normal file
View file

@ -0,0 +1,229 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get Started &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="next" title="API Reference" href="reference.html" />
<link rel="prev" title="All Contents" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="reference.html" title="API Reference"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="All Contents"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="get-started">
<h1>Get Started<a class="headerlink" href="#get-started" title="Permalink to this headline"></a></h1>
<div class="section" id="module-django_select2">
<span id="overview"></span><h2>Overview<a class="headerlink" href="#module-django_select2" title="Permalink to this headline"></a></h2>
<p>This is a <a class="reference external" href="https://www.djangoproject.com/">Django</a> integration of <a class="reference external" href="http://ivaynberg.github.com/select2/">Select2</a>.</p>
<p>The app includes Select2 driven Django Widgets and Form Fields.</p>
<div class="section" id="widgets">
<h3>Widgets<a class="headerlink" href="#widgets" title="Permalink to this headline"></a></h3>
<p>These components are responsible for rendering the necessary Javascript and HTML markups. Since this whole
package is to render choices using Select2 Javascript library, hence these components are meant to be used
with choice fields.</p>
<p>Widgets are generally of two types :-</p>
<blockquote>
<div><p>1. <strong>Light</strong> &#8211;
They are not meant to be used when there are too many options, say, in thousands. This
is because all those options would have to be pre-rendered onto the page and Javascript would
be used to search through them. Said that, they are also one the most easiest to use. They are almost
drop-in-replacement for Django&#8217;s default select widgets.</p>
<p>2. <strong>Heavy</strong> &#8211;
They are suited for scenarios when the number of options are large and need complex queries
(from maybe different sources) to get the options. This dynamic fetching of options undoubtably requires
Ajax communication with the server. Django-Select2 includes a helper JS file which is included automatically,
so you need not worry about writing any Ajax related JS code. Although on the server side you do need to
create a view specifically to respond to the queries.</p>
<p>Heavies have further specialized versions called &#8211; <strong>Auto Heavy</strong>. These do not require views to server Ajax
request. When they are instantiated, they register themselves with one central view which handels Ajax requests
for them.</p>
</div></blockquote>
<p>Heavy widgets have the word &#8216;Heavy&#8217; in their name. Light widgets are normally named, i.e. there is no &#8216;Light&#8217; word
in their names.</p>
<p><strong>Available widgets:</strong></p>
<p><a class="reference internal" href="ref_widgets.html#django_select2.widgets.Select2Widget" title="django_select2.widgets.Select2Widget"><tt class="xref py py-class docutils literal"><span class="pre">Select2Widget</span></tt></a>, <a class="reference internal" href="ref_widgets.html#django_select2.widgets.Select2MultipleWidget" title="django_select2.widgets.Select2MultipleWidget"><tt class="xref py py-class docutils literal"><span class="pre">Select2MultipleWidget</span></tt></a>, <a class="reference internal" href="ref_widgets.html#django_select2.widgets.HeavySelect2Widget" title="django_select2.widgets.HeavySelect2Widget"><tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2Widget</span></tt></a>, <a class="reference internal" href="ref_widgets.html#django_select2.widgets.HeavySelect2MultipleWidget" title="django_select2.widgets.HeavySelect2MultipleWidget"><tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2MultipleWidget</span></tt></a>,
<a class="reference internal" href="ref_widgets.html#django_select2.widgets.AutoHeavySelect2Widget" title="django_select2.widgets.AutoHeavySelect2Widget"><tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2Widget</span></tt></a>, <a class="reference internal" href="ref_widgets.html#django_select2.widgets.AutoHeavySelect2MultipleWidget" title="django_select2.widgets.AutoHeavySelect2MultipleWidget"><tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2MultipleWidget</span></tt></a></p>
<p><a class="reference external" href="http://blog.applegrew.com/2012/08/django-select2/">Read more</a></p>
</div>
<div class="section" id="fields">
<h3>Fields<a class="headerlink" href="#fields" title="Permalink to this headline"></a></h3>
<p>These are pre-implemented choice fields which use the above widgets. It is highly recommended that you use them
instead of rolling your own.</p>
<p>The fields available are good for general purpose use, although more specialized versions too are available for
your ease.</p>
<p><strong>Available fields:</strong></p>
<p><a class="reference internal" href="ref_fields.html#django_select2.fields.Select2ChoiceField" title="django_select2.fields.Select2ChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">Select2ChoiceField</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.Select2MultipleChoiceField" title="django_select2.fields.Select2MultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">Select2MultipleChoiceField</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.HeavySelect2ChoiceField" title="django_select2.fields.HeavySelect2ChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2ChoiceField</span></tt></a>,
<a class="reference internal" href="ref_fields.html#django_select2.fields.HeavySelect2MultipleChoiceField" title="django_select2.fields.HeavySelect2MultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2MultipleChoiceField</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.HeavyModelSelect2ChoiceField" title="django_select2.fields.HeavyModelSelect2ChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">HeavyModelSelect2ChoiceField</span></tt></a>,
<a class="reference internal" href="ref_fields.html#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="django_select2.fields.HeavyModelSelect2MultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">HeavyModelSelect2MultipleChoiceField</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.ModelSelect2Field" title="django_select2.fields.ModelSelect2Field"><tt class="xref py py-class docutils literal"><span class="pre">ModelSelect2Field</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.ModelSelect2MultipleField" title="django_select2.fields.ModelSelect2MultipleField"><tt class="xref py py-class docutils literal"><span class="pre">ModelSelect2MultipleField</span></tt></a>,
<a class="reference internal" href="ref_fields.html#django_select2.fields.AutoSelect2Field" title="django_select2.fields.AutoSelect2Field"><tt class="xref py py-class docutils literal"><span class="pre">AutoSelect2Field</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.AutoSelect2MultipleField" title="django_select2.fields.AutoSelect2MultipleField"><tt class="xref py py-class docutils literal"><span class="pre">AutoSelect2MultipleField</span></tt></a>, <a class="reference internal" href="ref_fields.html#django_select2.fields.AutoModelSelect2Field" title="django_select2.fields.AutoModelSelect2Field"><tt class="xref py py-class docutils literal"><span class="pre">AutoModelSelect2Field</span></tt></a>,
<a class="reference internal" href="ref_fields.html#django_select2.fields.AutoModelSelect2MultipleField" title="django_select2.fields.AutoModelSelect2MultipleField"><tt class="xref py py-class docutils literal"><span class="pre">AutoModelSelect2MultipleField</span></tt></a></p>
</div>
<div class="section" id="views">
<h3>Views<a class="headerlink" href="#views" title="Permalink to this headline"></a></h3>
<p>The view - <cite>Select2View</cite>, exposed here is meant to be used with &#8216;Heavy&#8217; fields and widgets.</p>
<p><strong>Imported:</strong></p>
<p><a class="reference internal" href="ref_views.html#django_select2.views.Select2View" title="django_select2.views.Select2View"><tt class="xref py py-class docutils literal"><span class="pre">Select2View</span></tt></a>, <a class="reference internal" href="ref_views.html#django_select2.views.NO_ERR_RESP" title="django_select2.views.NO_ERR_RESP"><tt class="xref py py-data docutils literal"><span class="pre">NO_ERR_RESP</span></tt></a></p>
<p><a class="reference external" href="http://blog.applegrew.com/2012/08/django-select2/">Read more</a></p>
</div>
</div>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h2>
<ol class="arabic">
<li><p class="first">Install <cite>django_select2</cite>:</p>
<div class="highlight-python"><pre>pip install django_select2</pre>
</div>
</li>
<li><p class="first">Add <cite>django_select2</cite> to your <cite>INSTALLED_APPS</cite> in your project settings.</p>
</li>
<li><p class="first">When deploying on production server, run:</p>
<div class="highlight-python"><pre>python manage.py collectstatic</pre>
</div>
</li>
</ol>
</div>
<div class="section" id="available-setting">
<h2>Available Setting<a class="headerlink" href="#available-setting" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">AUTO_RENDER_SELECT2_STATICS</span></tt> [Default <tt class="docutils literal"><span class="pre">True</span></tt>]</p>
<p>This, when specified and set to <tt class="docutils literal"><span class="pre">False</span></tt> in <tt class="docutils literal"><span class="pre">settings.py</span></tt> then Django_Select2 widgets won&#8217;t automatically include the required scripts and stylesheets. When this setting is <tt class="docutils literal"><span class="pre">True</span></tt> then every Select2 field on the page will output <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> and <tt class="docutils literal"><span class="pre">&lt;link&gt;</span></tt> tags to include the required JS and CSS files. This is convinient but will output the same JS and CSS files multiple times if there are more than one Select2 fields on the page.</p>
<p>When this settings is <tt class="docutils literal"><span class="pre">False</span></tt> then you are responsible for including the JS and CSS files. To help you with this the following template tags are available in <tt class="docutils literal"><span class="pre">django_select2_tags</span></tt>.</p>
<blockquote>
<div><ul class="simple">
<li><tt class="docutils literal"><span class="pre">import_django_select2_js</span></tt> - Outputs <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> tags to include all the JS files, required by Light and Heavy widgets.</li>
<li><tt class="docutils literal"><span class="pre">import_django_select2_css</span></tt> - Outputs <tt class="docutils literal"><span class="pre">&lt;link&gt;</span></tt> tags to include all the CSS files, required by Light and Heavy widgets.</li>
<li><tt class="docutils literal"><span class="pre">import_django_select2_js_css</span></tt> - Outputs both <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> and <tt class="docutils literal"><span class="pre">&lt;link&gt;</span></tt> tags to include all the JS and CSS files, required by Light and Heavy widgets.</li>
</ul>
</div></blockquote>
<p>Make sure to include them at the top of the page, prefereably in <tt class="docutils literal"><span class="pre">&lt;head&gt;...&lt;/head&gt;</span></tt>.</p>
</div>
<div class="section" id="external-dependencies">
<h2>External Dependencies<a class="headerlink" href="#external-dependencies" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Django - This is obvious.</li>
<li>jQuery - This is not included in the package since it is expected that in most scenarios this would already be available. The above template tags also won&#8217;t out <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> tag to include this. You need to do this yourself.</li>
</ul>
</div>
<div class="section" id="example-application">
<h2>Example Application<a class="headerlink" href="#example-application" title="Permalink to this headline"></a></h2>
<p>Please see <tt class="docutils literal"><span class="pre">testapp</span></tt> application. This application is used to manually test the functionalities of this package. This also serves as a good example.</p>
<p>You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Get Started</a><ul>
<li><a class="reference internal" href="#module-django_select2">Overview</a><ul>
<li><a class="reference internal" href="#widgets">Widgets</a></li>
<li><a class="reference internal" href="#fields">Fields</a></li>
<li><a class="reference internal" href="#views">Views</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#available-setting">Available Setting</a></li>
<li><a class="reference internal" href="#external-dependencies">External Dependencies</a></li>
<li><a class="reference internal" href="#example-application">Example Application</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">All Contents</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="reference.html"
title="next chapter">API Reference</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/get_started.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="reference.html" title="API Reference"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="All Contents"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2012, Nirupam Biswas.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>All Contents &mdash; Django-Select2 3.0.1 documentation</title>
<title>All Contents &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,8 +24,8 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="#" />
<link rel="next" title="Overview" href="overview.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="#" />
<link rel="next" title="Get Started" href="get_started.html" />
</head>
<body>
<div class="related">
@ -38,9 +38,9 @@
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="overview.html" title="Overview"
<a href="get_started.html" title="Get Started"
accesskey="N">next</a> |</li>
<li><a href="#">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="#">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -54,12 +54,17 @@
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="overview.html#widgets">Widgets</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#fields">Fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#views">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#external-dependencies">External Dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#example-application">Example Application</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="get_started.html#module-django_select2">Overview</a><ul>
<li class="toctree-l3"><a class="reference internal" href="get_started.html#widgets">Widgets</a></li>
<li class="toctree-l3"><a class="reference internal" href="get_started.html#fields">Fields</a></li>
<li class="toctree-l3"><a class="reference internal" href="get_started.html#views">Views</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="get_started.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.html#available-setting">Available Setting</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.html#external-dependencies">External Dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.html#example-application">Example Application</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">API Reference</a><ul>
@ -112,8 +117,8 @@
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="overview.html"
title="next chapter">Overview</a></p>
<p class="topless"><a href="get_started.html"
title="next chapter">Get Started</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
@ -146,9 +151,9 @@
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="overview.html" title="Overview"
<a href="get_started.html" title="Get Started"
>next</a> |</li>
<li><a href="#">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="#">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

Binary file not shown.

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Python Module Index &mdash; Django-Select2 3.0.1 documentation</title>
<title>Python Module Index &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
@ -39,7 +39,7 @@
<li class="right" >
<a href="#" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -63,7 +63,7 @@
<td><img src="_static/minus.png" class="toggler"
id="toggle-1" style="display: none" alt="-" /></td>
<td>
<a href="overview.html#module-django_select2"><tt class="xref">django_select2</tt></a></td><td>
<a href="get_started.html#module-django_select2"><tt class="xref">django_select2</tt></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
@ -119,7 +119,7 @@
<li class="right" >
<a href="#" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fields &mdash; Django-Select2 3.0.1 documentation</title>
<title>Fields &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="up" title="API Reference" href="reference.html" />
<link rel="next" title="Views" href="ref_views.html" />
<link rel="prev" title="Widgets" href="ref_widgets.html" />
@ -45,7 +45,7 @@
<li class="right" >
<a href="ref_widgets.html" title="Widgets"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" accesskey="U">API Reference</a> &raquo;</li>
</ul>
</div>
@ -60,59 +60,59 @@
<div class="section" id="class-diagrams">
<h2>Class Diagrams<a class="headerlink" href="#class-diagrams" title="Permalink to this headline"></a></h2>
<p class="graphviz">
<img src="_images/inheritance-88dec5533f5bfed5f1c78156107e6abfdec33433.png" alt="Inheritance diagram of django_select2.fields.Select2ChoiceField, django_select2.fields.Select2MultipleChoiceField" usemap="#inheritance25da809ef3" class="inheritance"/>
<img src="_images/inheritance-678260b7e4ffe565d2819040ab9288f2db3eeb5b.png" alt="Inheritance diagram of django_select2.fields.Select2ChoiceField, django_select2.fields.Select2MultipleChoiceField" usemap="#inheritance25da809ef3" class="inheritance"/>
<map id="inheritance25da809ef3" name="inheritance25da809ef3">
<area shape="poly" id="node8" href="#django_select2.fields.Select2ChoiceField" title="Select2ChoiceField" alt="" coords="459,188,454,183,440,178,418,174,391,172,360,171,329,172,302,174,280,178,266,183,261,188,266,193,280,198,302,202,329,204,360,205,391,204,418,202,440,198,454,193"/>
<area shape="poly" id="node4" href="#django_select2.fields.Select2MultipleChoiceField" title="Select2MultipleChoiceField" alt="" coords="270,271,264,265,245,261,215,257,178,255,137,254,96,255,59,257,30,261,11,265,4,271,11,276,30,281,59,284,96,287,137,288,178,287,215,284,245,281,264,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.Select2ChoiceField" title="Select2ChoiceField" alt="" coords="203,188,198,183,184,178,162,174,135,172,104,171,73,172,46,174,24,178,10,183,5,188,10,193,24,198,46,202,73,204,104,205,135,204,162,202,184,198,198,193"/>
<area shape="poly" id="node6" href="#django_select2.fields.Select2MultipleChoiceField" title="Select2MultipleChoiceField" alt="" coords="460,271,453,265,434,261,405,257,368,255,327,254,286,255,249,257,219,261,200,265,194,271,200,276,219,281,249,284,286,287,327,288,368,287,405,284,434,281,453,276"/>
</map>
</p>
<p class="graphviz">
<img src="_images/inheritance-ad0befd50612306d963f57238e5636f0cf941700.png" alt="Inheritance diagram of django_select2.fields.ModelSelect2Field, django_select2.fields.ModelSelect2MultipleField" usemap="#inheritance2f6096d7d4" class="inheritance"/>
<img src="_images/inheritance-4b1d6b10ca70d06ff3bdaedfdeb0f490271ab780.png" alt="Inheritance diagram of django_select2.fields.ModelSelect2Field, django_select2.fields.ModelSelect2MultipleField" usemap="#inheritance2f6096d7d4" class="inheritance"/>
<map id="inheritance2f6096d7d4" name="inheritance2f6096d7d4">
<area shape="poly" id="node4" href="#django_select2.fields.ModelSelect2Field" title="ModelSelect2Field" alt="" coords="195,271,191,265,177,261,156,257,129,255,100,254,71,255,44,257,23,261,9,265,5,271,9,276,23,281,44,284,71,287,100,288,129,287,156,284,177,281,191,276"/>
<area shape="poly" id="node15" href="#django_select2.fields.ModelSelect2MultipleField" title="ModelSelect2MultipleField" alt="" coords="474,353,468,348,450,343,421,340,385,337,345,336,305,337,269,340,241,343,222,348,216,353,222,359,241,363,269,367,305,369,345,370,385,369,421,367,450,363,468,359"/>
<area shape="poly" id="node15" href="#django_select2.fields.ModelSelect2Field" title="ModelSelect2Field" alt="" coords="195,271,191,265,177,261,156,257,129,255,100,254,71,255,44,257,23,261,9,265,5,271,9,276,23,281,44,284,71,287,100,288,129,287,156,284,177,281,191,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.ModelSelect2MultipleField" title="ModelSelect2MultipleField" alt="" coords="474,353,468,348,450,343,421,340,385,337,345,336,305,337,269,340,241,343,222,348,216,353,222,359,241,363,269,367,305,369,345,370,385,369,421,367,450,363,468,359"/>
</map>
</p>
<p class="graphviz">
<img src="_images/inheritance-53de5bc32ecd93d09a06994c473f76aeab86e5ad.png" alt="Inheritance diagram of django_select2.fields.HeavyModelSelect2ChoiceField, django_select2.fields.HeavyModelSelect2MultipleChoiceField" usemap="#inheritance4f5879fafb" class="inheritance"/>
<img src="_images/inheritance-ec9061b1ce79cb3458b2a03dda866f28220fd112.png" alt="Inheritance diagram of django_select2.fields.HeavyModelSelect2ChoiceField, django_select2.fields.HeavyModelSelect2MultipleChoiceField" usemap="#inheritance4f5879fafb" class="inheritance"/>
<map id="inheritance4f5879fafb" name="inheritance4f5879fafb">
<area shape="poly" id="node17" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="454,271,447,265,425,261,392,257,350,255,303,254,256,255,213,257,180,261,158,265,151,271,158,276,180,281,213,284,256,287,303,288,350,287,392,284,425,281,447,276"/>
<area shape="poly" id="node14" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="544,353,535,348,509,343,468,340,416,337,359,336,301,337,249,340,208,343,182,348,173,353,182,359,208,363,249,367,301,369,359,370,416,369,468,367,509,363,535,359"/>
<area shape="poly" id="node13" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="281,188,274,183,255,178,224,174,185,172,143,171,100,172,61,174,31,178,11,183,4,188,11,193,31,198,61,202,100,204,143,205,185,204,224,202,255,198,274,193"/>
<area shape="poly" id="node9" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="454,271,447,265,425,261,392,257,350,255,303,254,256,255,213,257,180,261,158,265,151,271,158,276,180,281,213,284,256,287,303,288,350,287,392,284,425,281,447,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="544,353,535,348,509,343,468,340,416,337,359,336,301,337,249,340,208,343,182,348,173,353,182,359,208,363,249,367,301,369,359,370,416,369,468,367,509,363,535,359"/>
<area shape="poly" id="node5" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="281,188,274,183,255,178,224,174,185,172,143,171,100,172,61,174,31,178,11,183,4,188,11,193,31,198,61,202,100,204,143,205,185,204,224,202,255,198,274,193"/>
</map>
</p>
<p class="graphviz">
<img src="_images/inheritance-b65738d86644639b081c60cc21b5ceb0047569d2.png" alt="Inheritance diagram of django_select2.fields.AutoSelect2Field, django_select2.fields.AutoSelect2MultipleField" usemap="#inheritanceea81e519c1" class="inheritance"/>
<img src="_images/inheritance-f719bd46672e39ef07678f67921c359cc81bb9e2.png" alt="Inheritance diagram of django_select2.fields.AutoSelect2Field, django_select2.fields.AutoSelect2MultipleField" usemap="#inheritanceea81e519c1" class="inheritance"/>
<map id="inheritanceea81e519c1" name="inheritanceea81e519c1">
<area shape="poly" id="node1" href="#django_select2.fields.HeavyChoiceField" title="HeavyChoiceField" alt="" coords="463,105,459,100,445,95,425,92,399,89,371,88,342,89,316,92,296,95,283,100,278,105,283,111,296,115,316,119,342,121,371,122,399,121,425,119,445,115,459,111"/>
<area shape="poly" id="node7" href="#django_select2.fields.HeavySelect2ChoiceField" title="HeavySelect2ChoiceField" alt="" coords="256,271,250,265,232,261,204,257,169,255,131,254,92,255,57,257,29,261,11,265,5,271,11,276,29,281,57,284,92,287,131,288,169,287,204,284,232,281,250,276"/>
<area shape="poly" id="node13" href="#django_select2.fields.HeavyMultipleChoiceField" title="HeavyMultipleChoiceField" alt="" coords="778,188,772,183,754,178,726,174,691,172,652,171,613,172,578,174,550,178,532,183,526,188,532,193,550,198,578,202,613,204,652,205,691,204,726,202,754,198,772,193"/>
<area shape="poly" id="node2" href="#django_select2.fields.ChoiceMixin" title="ChoiceMixin" alt="" coords="375,23,372,17,362,13,347,9,329,7,308,6,287,7,269,9,254,13,244,17,241,23,244,28,254,33,269,36,287,39,308,40,329,39,347,36,362,33,372,28"/>
<area shape="poly" id="node6" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="477,271,472,265,458,261,436,257,409,255,379,254,348,255,321,257,299,261,285,265,281,271,285,276,299,281,321,284,348,287,379,288,409,287,436,284,458,281,472,276"/>
<area shape="poly" id="node15" href="#django_select2.fields.AutoSelect2MultipleField" title="AutoSelect2MultipleField" alt="" coords="624,353,617,348,600,343,573,340,538,337,500,336,462,337,427,340,400,343,383,348,376,353,383,359,400,363,427,367,462,369,500,370,538,369,573,367,600,363,617,359"/>
<area shape="poly" id="node18" href="#django_select2.fields.AutoSelect2Field" title="AutoSelect2Field" alt="" coords="347,353,343,348,330,343,310,340,285,337,257,336,230,337,205,340,185,343,172,348,168,353,172,359,185,363,205,367,230,369,257,370,285,369,310,367,330,363,343,359"/>
<area shape="poly" id="node8" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="485,188,478,183,459,178,428,174,389,172,347,171,304,172,265,174,235,178,215,183,208,188,215,193,235,198,265,202,304,204,347,205,389,204,428,202,459,198,478,193"/>
<area shape="poly" id="node11" href="#django_select2.fields.HeavySelect2MultipleChoiceField" title="HeavySelect2MultipleChoiceField" alt="" coords="819,271,812,265,789,261,754,257,709,255,660,254,611,255,566,257,531,261,508,265,501,271,508,276,531,281,566,284,611,287,660,288,709,287,754,284,789,281,812,276"/>
<area shape="poly" id="node1" href="#django_select2.fields.AutoSelect2MultipleField" title="AutoSelect2MultipleField" alt="" coords="434,353,428,348,411,343,383,340,349,337,311,336,273,337,238,340,211,343,193,348,187,353,193,359,211,363,238,367,273,369,311,370,349,369,383,367,411,363,428,359"/>
<area shape="poly" id="node2" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="543,271,539,265,525,261,503,257,476,255,445,254,415,255,388,257,366,261,352,265,347,271,352,276,366,281,388,284,415,287,445,288,476,287,503,284,525,281,539,276"/>
<area shape="poly" id="node15" href="#django_select2.fields.AutoSelect2Field" title="AutoSelect2Field" alt="" coords="659,353,655,348,642,343,622,340,597,337,569,336,542,337,517,340,497,343,484,348,480,353,484,359,497,363,517,367,542,369,569,370,597,369,622,367,642,363,655,359"/>
<area shape="poly" id="node4" href="#django_select2.fields.HeavySelect2MultipleChoiceField" title="HeavySelect2MultipleChoiceField" alt="" coords="323,271,316,265,293,261,258,257,213,255,164,254,115,255,70,257,35,261,12,265,5,271,12,276,35,281,70,284,115,287,164,288,213,287,258,284,293,281,316,276"/>
<area shape="poly" id="node6" href="#django_select2.fields.ChoiceMixin" title="ChoiceMixin" alt="" coords="408,23,405,17,395,13,381,9,362,7,341,6,321,7,302,9,287,13,278,17,274,23,278,28,287,33,302,36,321,39,341,40,362,39,381,36,395,33,405,28"/>
<area shape="poly" id="node12" href="#django_select2.fields.HeavyChoiceField" title="HeavyChoiceField" alt="" coords="496,105,492,100,479,95,458,92,433,89,404,88,375,89,350,92,329,95,316,100,312,105,316,111,329,115,350,119,375,121,404,122,433,121,458,119,479,115,492,111"/>
<area shape="poly" id="node8" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="632,188,625,183,605,178,575,174,536,172,493,171,451,172,412,174,381,178,362,183,355,188,362,193,381,198,412,202,451,204,493,205,536,204,575,202,605,198,625,193"/>
<area shape="poly" id="node17" href="#django_select2.fields.HeavySelect2ChoiceField" title="HeavySelect2ChoiceField" alt="" coords="819,271,813,265,795,261,767,257,732,255,693,254,655,255,620,257,592,261,574,265,568,271,574,276,592,281,620,284,655,287,693,288,732,287,767,284,795,281,813,276"/>
<area shape="poly" id="node10" href="#django_select2.fields.HeavyMultipleChoiceField" title="HeavyMultipleChoiceField" alt="" coords="298,188,292,183,274,178,246,174,211,172,172,171,133,172,98,174,70,178,52,183,46,188,52,193,70,198,98,202,133,204,172,205,211,204,246,202,274,198,292,193"/>
</map>
</p>
<p class="graphviz">
<img src="_images/inheritance-33c09aa571160e654cfd73c711c0d2cfac17a52c.png" alt="Inheritance diagram of django_select2.fields.AutoModelSelect2Field" usemap="#inheritance0bde21cdb9" class="inheritance"/>
<img src="_images/inheritance-a9d555ec2dced2d7d73f101e33f45785b627b6c0.png" alt="Inheritance diagram of django_select2.fields.AutoModelSelect2Field" usemap="#inheritance0bde21cdb9" class="inheritance"/>
<map id="inheritance0bde21cdb9" name="inheritance0bde21cdb9">
<area shape="poly" id="node11" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="772,271,764,265,743,261,709,257,667,255,620,254,573,255,531,257,497,261,476,265,468,271,476,276,497,281,531,284,573,287,620,288,667,287,709,284,743,281,764,276"/>
<area shape="poly" id="node4" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="201,271,196,265,182,261,160,257,133,255,103,254,72,255,45,257,23,261,9,265,5,271,9,276,23,281,45,284,72,287,103,288,133,287,160,284,182,281,196,276"/>
<area shape="poly" id="node8" href="#django_select2.fields.AutoModelSelect2Field" title="AutoModelSelect2Field" alt="" coords="451,353,445,348,428,343,403,340,371,337,335,336,299,337,267,340,241,343,224,348,219,353,224,359,241,363,267,367,299,369,335,370,371,369,403,367,428,363,445,359"/>
<area shape="poly" id="node5" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="444,271,439,265,423,261,399,257,368,255,335,254,301,255,270,257,246,261,231,265,225,271,231,276,246,281,270,284,301,287,335,288,368,287,399,284,423,281,439,276"/>
<area shape="poly" id="node16" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="631,188,624,183,604,178,573,174,535,172,492,171,449,172,411,174,380,178,360,183,353,188,360,193,380,198,411,202,449,204,492,205,535,204,573,202,604,198,624,193"/>
<area shape="poly" id="node4" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="HeavyModelSelect2ChoiceField" alt="" coords="772,271,764,265,743,261,709,257,667,255,620,254,573,255,531,257,497,261,476,265,468,271,476,276,497,281,531,284,573,287,620,288,667,287,709,284,743,281,764,276"/>
<area shape="poly" id="node14" href="#django_select2.fields.AutoModelSelect2Field" title="AutoModelSelect2Field" alt="" coords="463,353,457,348,440,343,415,340,383,337,347,336,311,337,279,340,253,343,236,348,231,353,236,359,253,363,279,367,311,369,347,370,383,369,415,367,440,363,457,359"/>
<area shape="poly" id="node5" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="631,188,624,183,604,178,573,174,535,172,492,171,449,172,411,174,380,178,360,183,353,188,360,193,380,198,411,202,449,204,492,205,535,204,573,202,604,198,624,193"/>
<area shape="poly" id="node11" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="224,271,219,265,203,261,179,257,148,255,115,254,81,255,50,257,26,261,11,265,5,271,11,276,26,281,50,284,81,287,115,288,148,287,179,284,203,281,219,276"/>
<area shape="poly" id="node16" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="445,271,440,265,426,261,404,257,377,255,347,254,316,255,289,257,267,261,253,265,249,271,253,276,267,281,289,284,316,287,347,288,377,287,404,284,426,281,440,276"/>
</map>
</p>
<p class="graphviz">
<img src="_images/inheritance-2a5d737bd98b0ddb0f26a84b32e0bab0307aa8a1.png" alt="Inheritance diagram of django_select2.fields.AutoModelSelect2MultipleField" usemap="#inheritancea008ca3d81" class="inheritance"/>
<img src="_images/inheritance-0ab22635cc4afe0e66bb57daa3bca5e21e9efc32.png" alt="Inheritance diagram of django_select2.fields.AutoModelSelect2MultipleField" usemap="#inheritancea008ca3d81" class="inheritance"/>
<map id="inheritancea008ca3d81" name="inheritancea008ca3d81">
<area shape="poly" id="node4" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="201,353,196,348,182,343,160,340,133,337,103,336,72,337,45,340,23,343,9,348,5,353,9,359,23,363,45,367,72,369,103,370,133,369,160,367,182,363,196,359"/>
<area shape="poly" id="node6" href="#django_select2.fields.AutoModelSelect2MultipleField" title="AutoModelSelect2MultipleField" alt="" coords="485,436,477,431,456,426,423,422,381,420,335,419,288,420,247,422,213,426,192,431,185,436,192,441,213,446,247,450,288,452,335,453,381,452,423,450,456,446,477,441"/>
<area shape="poly" id="node5" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="444,353,439,348,423,343,399,340,368,337,335,336,301,337,270,340,246,343,231,348,225,353,231,359,246,363,270,367,301,369,335,370,368,369,399,367,423,363,439,359"/>
<area shape="poly" id="node9" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="839,353,830,348,804,343,763,340,711,337,653,336,596,337,544,340,503,343,477,348,468,353,477,359,503,363,544,367,596,369,653,370,711,369,763,367,804,363,830,359"/>
<area shape="poly" id="node17" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="647,271,640,265,620,261,589,257,551,255,508,254,465,255,427,257,396,261,376,265,369,271,376,276,396,281,427,284,465,287,508,288,551,287,589,284,620,281,640,276"/>
<area shape="poly" id="node1" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="HeavyModelSelect2MultipleChoiceField" alt="" coords="840,353,831,348,805,343,764,340,712,337,655,336,597,337,545,340,504,343,478,348,469,353,478,359,504,363,545,367,597,369,655,370,712,369,764,367,805,363,831,359"/>
<area shape="poly" id="node14" href="#django_select2.fields.AutoModelSelect2MultipleField" title="AutoModelSelect2MultipleField" alt="" coords="497,436,489,431,468,426,435,422,393,420,347,419,300,420,259,422,225,426,204,431,197,436,204,441,225,446,259,450,300,452,347,453,393,452,435,450,468,446,489,441"/>
<area shape="poly" id="node2" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="HeavySelect2FieldBaseMixin" alt="" coords="648,271,641,265,621,261,591,257,552,255,509,254,467,255,428,257,397,261,378,265,371,271,378,276,397,281,428,284,467,287,509,288,552,287,591,284,621,281,641,276"/>
<area shape="poly" id="node11" href="#django_select2.fields.ModelResultJsonMixin" title="ModelResultJsonMixin" alt="" coords="224,353,219,348,203,343,179,340,148,337,115,336,81,337,50,340,26,343,11,348,5,353,11,359,26,363,50,367,81,369,115,370,148,369,179,367,203,363,219,359"/>
<area shape="poly" id="node16" href="#django_select2.fields.AutoViewFieldMixin" title="AutoViewFieldMixin" alt="" coords="445,353,440,348,426,343,404,340,377,337,347,336,316,337,289,340,267,343,253,348,249,353,253,359,267,363,289,367,316,369,347,370,377,369,404,367,426,363,440,359"/>
</map>
</p>
</div>
@ -693,7 +693,7 @@ json query requests for that type (class).</p>
<li class="right" >
<a href="ref_widgets.html" title="Widgets"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" >API Reference</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Util &mdash; Django-Select2 3.0.1 documentation</title>
<title>Util &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="up" title="API Reference" href="reference.html" />
<link rel="prev" title="Views" href="ref_views.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="ref_views.html" title="Views"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" accesskey="U">API Reference</a> &raquo;</li>
</ul>
</div>
@ -56,7 +56,7 @@
<div class="section" id="class-diagram">
<h2>Class Diagram<a class="headerlink" href="#class-diagram" title="Permalink to this headline"></a></h2>
<p class="graphviz">
<img src="_images/inheritance-46ef0cf424562cdb74d4666f71ab5a9fff682049.png" alt="Inheritance diagram of django_select2.util" usemap="#inheritance39128e562c" class="inheritance"/>
<img src="_images/inheritance-3ef5ce950030c171e36826075ec800f66ce93ee7.png" alt="Inheritance diagram of django_select2.util" usemap="#inheritance39128e562c" class="inheritance"/>
<map id="inheritance39128e562c" name="inheritance39128e562c">
<area shape="poly" id="node1" href="#django_select2.util.JSFunctionInContext" title="JSFunctionInContext" alt="" coords="212,105,207,100,192,95,169,92,140,89,108,88,76,89,47,92,24,95,9,100,4,105,9,111,24,115,47,119,76,121,108,122,140,121,169,119,192,115,207,111"/>
<area shape="poly" id="node2" href="#django_select2.util.JSVar" title="JSVar" alt="" coords="241,23,239,17,234,13,225,9,215,7,203,6,191,7,180,9,171,13,166,17,164,23,166,28,171,33,180,36,191,39,203,40,215,39,225,36,234,33,239,28"/>
@ -348,7 +348,7 @@ Id generated that time, would be returned.</p>
<li class="right" >
<a href="ref_views.html" title="Views"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" >API Reference</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Views &mdash; Django-Select2 3.0.1 documentation</title>
<title>Views &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="up" title="API Reference" href="reference.html" />
<link rel="next" title="Util" href="ref_util.html" />
<link rel="prev" title="Fields" href="ref_fields.html" />
@ -45,7 +45,7 @@
<li class="right" >
<a href="ref_fields.html" title="Fields"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" accesskey="U">API Reference</a> &raquo;</li>
</ul>
</div>
@ -60,11 +60,11 @@
<div class="section" id="class-diagram">
<h2>Class Diagram<a class="headerlink" href="#class-diagram" title="Permalink to this headline"></a></h2>
<p class="graphviz">
<img src="_images/inheritance-882b6039211cfb019a78eb35637fefe1f26f6259.png" alt="Inheritance diagram of django_select2.views" usemap="#inheritanceb5a6c91e22" class="inheritance"/>
<img src="_images/inheritance-8f86687edea78af6b03674dd01b62167b65659b1.png" alt="Inheritance diagram of django_select2.views" usemap="#inheritanceb5a6c91e22" class="inheritance"/>
<map id="inheritanceb5a6c91e22" name="inheritanceb5a6c91e22">
<area shape="poly" id="node1" href="#django_select2.views.Select2View" title="Select2View" alt="" coords="254,105,251,100,241,95,226,92,207,89,185,88,164,89,145,92,130,95,120,100,117,105,120,111,130,115,145,119,164,121,185,122,207,121,226,119,241,115,251,111"/>
<area shape="poly" id="node6" href="#django_select2.views.AutoResponseView" title="AutoResponseView" alt="" coords="285,188,280,183,266,178,244,174,216,172,185,171,154,172,127,174,104,178,90,183,85,188,90,193,104,198,127,202,154,204,185,205,216,204,244,202,266,198,280,193"/>
<area shape="poly" id="node2" href="#django_select2.views.JSONResponseMixin" title="JSONResponseMixin" alt="" coords="206,23,201,17,187,13,165,9,137,7,105,6,74,7,46,9,24,13,9,17,4,23,9,28,24,33,46,36,74,39,105,40,137,39,165,36,187,33,201,28"/>
<area shape="poly" id="node3" href="#django_select2.views.Select2View" title="Select2View" alt="" coords="190,105,187,100,177,95,162,92,143,89,121,88,100,89,81,92,66,95,56,100,53,105,56,111,66,115,81,119,100,121,121,122,143,121,162,119,177,115,187,111"/>
<area shape="poly" id="node2" href="#django_select2.views.JSONResponseMixin" title="JSONResponseMixin" alt="" coords="304,23,299,17,284,13,262,9,234,7,203,6,171,7,143,9,121,13,107,17,102,23,107,28,121,33,143,36,171,39,203,40,234,39,262,36,284,33,299,28"/>
<area shape="poly" id="node6" href="#django_select2.views.AutoResponseView" title="AutoResponseView" alt="" coords="221,188,216,183,202,178,180,174,152,172,121,171,90,172,63,174,40,178,26,183,21,188,26,193,40,198,63,202,90,204,121,205,152,204,180,202,202,198,216,193"/>
</map>
</p>
</div>
@ -274,7 +274,7 @@ Although it is not mandatory to use, but is immensely helpful.</p>
<li class="right" >
<a href="ref_fields.html" title="Fields"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" >API Reference</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Widgets &mdash; Django-Select2 3.0.1 documentation</title>
<title>Widgets &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="up" title="API Reference" href="reference.html" />
<link rel="next" title="Fields" href="ref_fields.html" />
<link rel="prev" title="API Reference" href="reference.html" />
@ -45,7 +45,7 @@
<li class="right" >
<a href="reference.html" title="API Reference"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" accesskey="U">API Reference</a> &raquo;</li>
</ul>
</div>
@ -60,18 +60,18 @@
<div class="section" id="class-diagram">
<h2>Class Diagram<a class="headerlink" href="#class-diagram" title="Permalink to this headline"></a></h2>
<p class="graphviz">
<img src="_images/inheritance-73a77eaa83e52671ed86f568bd3bda807cd84e60.png" alt="Inheritance diagram of django_select2.widgets" usemap="#inheritancecdbd4d640c" class="inheritance"/>
<img src="_images/inheritance-e1548d1103f6e3fed96f81fce7172f7812476ef2.png" alt="Inheritance diagram of django_select2.widgets" usemap="#inheritancecdbd4d640c" class="inheritance"/>
<map id="inheritancecdbd4d640c" name="inheritancecdbd4d640c">
<area shape="poly" id="node7" href="#django_select2.widgets.Select2Widget" title="Select2Widget" alt="" coords="630,271,626,265,615,261,597,257,575,255,551,254,526,255,504,257,487,261,475,265,471,271,475,276,487,281,504,284,526,287,551,288,575,287,597,284,615,281,626,276"/>
<area shape="poly" id="node4" href="#django_select2.widgets.MultipleSelect2HiddenInput" title="MultipleSelect2HiddenInput" alt="" coords="995,271,989,265,969,261,939,257,901,255,859,254,816,255,778,257,748,261,729,265,722,271,729,276,748,281,778,284,816,287,859,288,901,287,939,284,969,281,989,276"/>
<area shape="poly" id="node14" href="#django_select2.widgets.HeavySelect2MultipleWidget" title="HeavySelect2MultipleWidget" alt="" coords="1008,353,1001,348,981,343,950,340,911,337,868,336,825,337,786,340,755,343,735,348,728,353,735,359,755,363,786,367,825,369,868,370,911,369,950,367,981,363,1001,359"/>
<area shape="poly" id="node22" href="#django_select2.widgets.HeavySelect2Widget" title="HeavySelect2Widget" alt="" coords="447,353,442,348,427,343,403,340,374,337,341,336,309,337,279,340,256,343,241,348,236,353,241,359,256,363,279,367,309,369,341,370,374,369,403,367,427,363,442,359"/>
<area shape="poly" id="node8" href="#django_select2.widgets.Select2Mixin" title="Select2Mixin" alt="" coords="420,188,417,183,407,178,392,174,372,172,351,171,329,172,310,174,294,178,284,183,281,188,284,193,294,198,310,202,329,204,351,205,372,204,392,202,407,198,417,193"/>
<area shape="poly" id="node15" href="#django_select2.widgets.HeavySelect2Mixin" title="HeavySelect2Mixin" alt="" coords="447,271,442,265,428,261,407,257,380,255,351,254,321,255,294,257,273,261,259,265,255,271,259,276,273,281,294,284,321,287,351,288,380,287,407,284,428,281,442,276"/>
<area shape="poly" id="node26" href="#django_select2.widgets.Select2MultipleWidget" title="Select2MultipleWidget" alt="" coords="230,271,225,265,209,261,184,257,152,255,117,254,82,255,51,257,26,261,10,265,4,271,10,276,26,281,51,284,82,287,117,288,152,287,184,284,209,281,225,276"/>
<area shape="poly" id="node13" href="#django_select2.widgets.AutoHeavySelect2Mixin" title="AutoHeavySelect2Mixin" alt="" coords="705,353,699,348,683,343,657,340,624,337,588,336,552,337,519,340,493,343,477,348,471,353,477,359,493,363,519,367,552,369,588,370,624,369,657,367,683,363,699,359"/>
<area shape="poly" id="node20" href="#django_select2.widgets.AutoHeavySelect2Widget" title="AutoHeavySelect2Widget" alt="" coords="576,436,569,431,552,426,524,422,488,420,449,419,410,420,375,422,347,426,329,431,323,436,329,441,347,446,375,450,410,452,449,453,488,452,524,450,552,446,569,441"/>
<area shape="poly" id="node31" href="#django_select2.widgets.AutoHeavySelect2MultipleWidget" title="AutoHeavySelect2MultipleWidget" alt="" coords="974,436,966,431,943,426,908,422,863,420,813,419,764,420,719,422,684,426,661,431,653,436,661,441,684,446,719,450,764,452,813,453,863,452,908,450,943,446,966,441"/>
<area shape="poly" id="node1" href="#django_select2.widgets.Select2MultipleWidget" title="Select2MultipleWidget" alt="" coords="630,271,625,265,609,261,584,257,552,255,517,254,482,255,451,257,426,261,410,265,404,271,410,276,426,281,451,284,482,287,517,288,552,287,584,284,609,281,625,276"/>
<area shape="poly" id="node2" href="#django_select2.widgets.Select2Mixin" title="Select2Mixin" alt="" coords="354,188,350,183,340,178,325,174,306,172,284,171,262,172,243,174,228,178,218,183,214,188,218,193,228,198,243,202,262,204,284,205,306,204,325,202,340,198,350,193"/>
<area shape="poly" id="node7" href="#django_select2.widgets.HeavySelect2Mixin" title="HeavySelect2Mixin" alt="" coords="380,271,375,265,362,261,341,257,314,255,284,254,254,255,227,257,206,261,193,265,188,271,193,276,206,281,227,284,254,287,284,288,314,287,341,284,362,281,375,276"/>
<area shape="poly" id="node21" href="#django_select2.widgets.Select2Widget" title="Select2Widget" alt="" coords="163,271,159,265,148,261,131,257,108,255,84,254,60,255,37,257,20,261,9,265,5,271,9,276,20,281,37,284,60,287,84,288,108,287,131,284,148,281,159,276"/>
<area shape="poly" id="node6" href="#django_select2.widgets.HeavySelect2Widget" title="HeavySelect2Widget" alt="" coords="994,353,988,348,973,343,950,340,921,337,888,336,855,337,826,340,803,343,788,348,782,353,788,359,803,363,826,367,855,369,888,370,921,369,950,367,973,363,988,359"/>
<area shape="poly" id="node31" href="#django_select2.widgets.AutoHeavySelect2Widget" title="AutoHeavySelect2Widget" alt="" coords="960,436,953,431,936,426,908,422,872,420,833,419,794,420,759,422,731,426,713,431,707,436,713,441,731,446,759,450,794,452,833,453,872,452,908,450,936,446,953,441"/>
<area shape="poly" id="node14" href="#django_select2.widgets.HeavySelect2MultipleWidget" title="HeavySelect2MultipleWidget" alt="" coords="501,353,494,348,474,343,443,340,404,337,361,336,318,337,279,340,248,343,229,348,222,353,229,359,248,363,279,367,318,369,361,370,404,369,443,367,474,363,494,359"/>
<area shape="poly" id="node19" href="#django_select2.widgets.MultipleSelect2HiddenInput" title="MultipleSelect2HiddenInput" alt="" coords="927,271,921,265,901,261,871,257,833,255,791,254,748,255,710,257,680,261,661,265,654,271,661,276,680,281,710,284,748,287,791,288,833,287,871,284,901,281,921,276"/>
<area shape="poly" id="node11" href="#django_select2.widgets.AutoHeavySelect2MultipleWidget" title="AutoHeavySelect2MultipleWidget" alt="" coords="630,436,622,431,599,426,564,422,519,420,469,419,420,420,375,422,340,426,317,431,309,436,317,441,340,446,375,450,420,452,469,453,519,452,564,450,599,446,622,441"/>
<area shape="poly" id="node12" href="#django_select2.widgets.AutoHeavySelect2Mixin" title="AutoHeavySelect2Mixin" alt="" coords="758,353,753,348,736,343,710,340,677,337,641,336,605,337,573,340,547,343,530,348,524,353,530,359,547,363,573,367,605,369,641,370,677,369,710,367,736,363,753,359"/>
</map>
</p>
</div>
@ -589,7 +589,7 @@ serve the request.</p>
<li class="right" >
<a href="reference.html" title="API Reference"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
<li><a href="reference.html" >API Reference</a> &raquo;</li>
</ul>
</div>

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>API Reference &mdash; Django-Select2 3.0.1 documentation</title>
<title>API Reference &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,9 +24,9 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<link rel="next" title="Widgets" href="ref_widgets.html" />
<link rel="prev" title="Overview" href="overview.html" />
<link rel="prev" title="Get Started" href="get_started.html" />
</head>
<body>
<div class="related">
@ -42,9 +42,9 @@
<a href="ref_widgets.html" title="Widgets"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="overview.html" title="Overview"
<a href="get_started.html" title="Get Started"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -90,8 +90,8 @@
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="overview.html"
title="previous chapter">Overview</a></p>
<p class="topless"><a href="get_started.html"
title="previous chapter">Get Started</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="ref_widgets.html"
title="next chapter">Widgets</a></p>
@ -130,9 +130,9 @@
<a href="ref_widgets.html" title="Widgets"
>next</a> |</li>
<li class="right" >
<a href="overview.html" title="Overview"
<a href="get_started.html" title="Get Started"
>previous</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

View file

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; Django-Select2 3.0.1 documentation</title>
<title>Search &mdash; Django-Select2 3.0.2 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1',
VERSION: '3.0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="Django-Select2 3.0.1 documentation" href="index.html" />
<link rel="top" title="Django-Select2 3.0.2 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
@ -42,7 +42,7 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
@ -93,7 +93,7 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">Django-Select2 3.0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Django-Select2 3.0.2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">

File diff suppressed because one or more lines are too long

49
docs/get_started.rst Normal file
View file

@ -0,0 +1,49 @@
===========
Get Started
===========
Overview
--------
.. automodule:: django_select2
:members:
Installation
------------
1. Install `django_select2`::
pip install django_select2
2. Add `django_select2` to your `INSTALLED_APPS` in your project settings.
3. When deploying on production server, run::
python manage.py collectstatic
Available Setting
-----------------
``AUTO_RENDER_SELECT2_STATICS`` [Default ``True``]
This, when specified and set to ``False`` in ``settings.py`` then Django_Select2 widgets won't automatically include the required scripts and stylesheets. When this setting is ``True`` then every Select2 field on the page will output ``<script>`` and ``<link>`` tags to include the required JS and CSS files. This is convinient but will output the same JS and CSS files multiple times if there are more than one Select2 fields on the page.
When this settings is ``False`` then you are responsible for including the JS and CSS files. To help you with this the following template tags are available in ``django_select2_tags``.
* ``import_django_select2_js`` - Outputs ``<script>`` tags to include all the JS files, required by Light and Heavy widgets.
* ``import_django_select2_css`` - Outputs ``<link>`` tags to include all the CSS files, required by Light and Heavy widgets.
* ``import_django_select2_js_css`` - Outputs both ``<script>`` and ``<link>`` tags to include all the JS and CSS files, required by Light and Heavy widgets.
Make sure to include them at the top of the page, prefereably in ``<head>...</head>``.
External Dependencies
---------------------
* Django - This is obvious.
* jQuery - This is not included in the package since it is expected that in most scenarios this would already be available. The above template tags also won't out ``<script>`` tag to include this. You need to do this yourself.
Example Application
-------------------
Please see ``testapp`` application. This application is used to manually test the functionalities of this package. This also serves as a good example.
You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.

View file

@ -10,7 +10,7 @@ Contents:
.. toctree::
overview
get_started
reference
Indices and tables

View file

@ -1,18 +0,0 @@
========
Overview
========
.. automodule:: django_select2
:members:
External Dependencies
=====================
* Django - This is obvious.
* jQuery - This is not included in the package since it is expected that in most scenarios this would already be available.
Example Application
===================
Please see ``testapp`` application. This application is used to manually test the functionalities of this package. This also serves as a good example.
You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.

View file

@ -171,3 +171,6 @@ LOGGING = {
},
}
}
AUTO_RENDER_SELECT2_STATICS = False

View file

@ -1,8 +1,12 @@
{% load staticfiles %}
{% load django_select2_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<script src="{{ STATIC_URL }}jquery-1.7.2.min.js"></script>
{% import_django_select2_js %}
{% import_django_select2_css %}
{% import_django_select2_js_css %} <!-- For testing importing it again, but with another tag -->
</head>
<body>
<form method="post" action="">