mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-20 15:20:23 +00:00
634 lines
No EOL
51 KiB
HTML
634 lines
No EOL
51 KiB
HTML
|
|
<!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>Fields — Django-Select2 3.0.1 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.1',
|
|
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.1 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" />
|
|
</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="ref_views.html" title="Views"
|
|
accesskey="N">next</a> |</li>
|
|
<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> »</li>
|
|
<li><a href="reference.html" accesskey="U">API Reference</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="module-django_select2.fields">
|
|
<span id="fields"></span><h1>Fields<a class="headerlink" href="#module-django_select2.fields" title="Permalink to this headline">¶</a></h1>
|
|
<p>Contains all the Django fields for Select2.</p>
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.AutoViewFieldMixin">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">AutoViewFieldMixin</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoViewFieldMixin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoViewFieldMixin" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
|
|
<p>Registers itself with AutoResponseView.</p>
|
|
<p>All Auto fields must sub-class this mixin, so that they are registered.</p>
|
|
<div class="admonition warning">
|
|
<p class="first admonition-title">Warning</p>
|
|
<p class="last">Do not forget to include <tt class="docutils literal"><span class="pre">'django_select2.urls'</span></tt> in your url conf, else,
|
|
central view used to serve Auto fields won’t be available.</p>
|
|
</div>
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.AutoViewFieldMixin.__init__">
|
|
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoViewFieldMixin.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoViewFieldMixin.__init__" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Class constructor.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>auto_id</strong> (<a class="reference external" href="http://docs.python.org/2.7/library/functions.html#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a>) – <p>The key to use while registering this field. If it is not provided then
|
|
an auto generated key is used.</p>
|
|
<div class="admonition tip">
|
|
<p class="first admonition-title">Tip</p>
|
|
<p>This mixin uses full class name of the field to register itself. This is
|
|
used like key in a <a class="reference external" href="http://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">dict</span></tt></a> by <a class="reference internal" href="ref_util.html#django_select2.util.register_field" title="django_select2.util.register_field"><tt class="xref py py-func docutils literal"><span class="pre">util.register_field()</span></tt></a>.</p>
|
|
<p>If that key already exists then the instance is not registered again. So, eventually
|
|
all instances of an Auto field share one instance to respond to the Ajax queries for
|
|
its fields.</p>
|
|
<p class="last">If for some reason any instance needs to be isolated then <tt class="docutils literal"><span class="pre">auto_id</span></tt> can be used to
|
|
provide a unique key which has never occured before.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.AutoViewFieldMixin.security_check">
|
|
<tt class="descname">security_check</tt><big>(</big><em>request</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoViewFieldMixin.security_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoViewFieldMixin.security_check" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns <tt class="docutils literal"><span class="pre">False</span></tt> if security check fails.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>request</strong> (<a class="reference external" href="http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest" title="(in Django v1.5)"><tt class="xref py py-class docutils literal"><span class="pre">django.http.HttpRequest</span></tt></a>) – The Ajax request object.</li>
|
|
<li><strong>args</strong> – The <tt class="docutils literal"><span class="pre">*args</span></tt> passed to <tt class="xref py py-meth docutils literal"><span class="pre">django.views.generic.View.dispatch()</span></tt>.</li>
|
|
<li><strong>kwargs</strong> – The <tt class="docutils literal"><span class="pre">**kwargs</span></tt> passed to <tt class="xref py py-meth docutils literal"><span class="pre">django.views.generic.View.dispatch()</span></tt>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A boolean value, signalling if check passed or failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">bool</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition warning">
|
|
<p class="first admonition-title">Warning</p>
|
|
<p class="last">Sub-classes should override this. You really do not want random people making
|
|
Http reqeusts to your server, be able to get access to sensitive information.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.AutoViewFieldMixin.get_results">
|
|
<tt class="descname">get_results</tt><big>(</big><em>request</em>, <em>term</em>, <em>page</em>, <em>context</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoViewFieldMixin.get_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoViewFieldMixin.get_results" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>See <a class="reference internal" href="ref_views.html#django_select2.views.Select2View.get_results" title="django_select2.views.Select2View.get_results"><tt class="xref py py-meth docutils literal"><span class="pre">views.Select2View.get_results()</span></tt></a>.</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.Select2ChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">Select2ChoiceField</tt><big>(</big><em>choices=()</em>, <em>required=True</em>, <em>widget=None</em>, <em>label=None</em>, <em>initial=None</em>, <em>help_text=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#Select2ChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.Select2ChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">django.forms.fields.ChoiceField</span></tt></p>
|
|
<p>Drop-in Select2 replacement for <tt class="xref py py-class docutils literal"><span class="pre">forms.ChoiceField</span></tt>.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.Select2ChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.Select2ChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">Select2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.Select2MultipleChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">Select2MultipleChoiceField</tt><big>(</big><em>choices=()</em>, <em>required=True</em>, <em>widget=None</em>, <em>label=None</em>, <em>initial=None</em>, <em>help_text=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#Select2MultipleChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.Select2MultipleChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">django.forms.fields.MultipleChoiceField</span></tt></p>
|
|
<p>Drop-in Select2 replacement for <tt class="xref py py-class docutils literal"><span class="pre">forms.MultipleChoiceField</span></tt>.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.Select2MultipleChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.Select2MultipleChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">Select2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.ModelResultJsonMixin">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">ModelResultJsonMixin</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelResultJsonMixin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelResultJsonMixin" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
|
|
<p>Makes <tt class="docutils literal"><span class="pre">heavy_data.js</span></tt> parsable JSON response for queries on its model.</p>
|
|
<p>On query it uses <a class="reference internal" href="#django_select2.fields.ModelResultJsonMixin.prepare_qs_params" title="django_select2.fields.ModelResultJsonMixin.prepare_qs_params"><tt class="xref py py-meth docutils literal"><span class="pre">prepare_qs_params()</span></tt></a> to prepare query attributes
|
|
which it then passes to <tt class="docutils literal"><span class="pre">self.queryset.filter()</span></tt> to get the results.</p>
|
|
<p>It is expected that sub-classes will defined a class field variable
|
|
<tt class="docutils literal"><span class="pre">search_fields</span></tt>, which should be a list of field names to search for.</p>
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.ModelResultJsonMixin.__init__">
|
|
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelResultJsonMixin.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelResultJsonMixin.__init__" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Class constructor.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
|
<li><strong>queryset</strong> (<a class="reference external" href="http://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet" title="(in Django v1.5)"><tt class="xref py py-class docutils literal"><span class="pre">django.db.models.query.QuerySet</span></tt></a> or None) – This can be passed as kwarg here or defined as field variabel,
|
|
like <tt class="docutils literal"><span class="pre">search_fields</span></tt>.</li>
|
|
<li><strong>max_results</strong> (<a class="reference external" href="http://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">int</span></tt></a>) – Maximum number to results to return per Ajax query.</li>
|
|
<li><strong>to_field_name</strong> (<a class="reference external" href="http://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>) – Which field’s value should be returned as result tuple’s
|
|
value. (Default is <tt class="docutils literal"><span class="pre">pk</span></tt>, i.e. the id field of the model)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.ModelResultJsonMixin.label_from_instance">
|
|
<tt class="descname">label_from_instance</tt><big>(</big><em>obj</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelResultJsonMixin.label_from_instance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelResultJsonMixin.label_from_instance" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sub-classes should override this to generate custom label texts for values.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>obj</strong> (<tt class="xref py py-class docutils literal"><span class="pre">django.model.Model</span></tt>) – The model object.</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The label string.</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/2.7/library/functions.html#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.ModelResultJsonMixin.prepare_qs_params">
|
|
<tt class="descname">prepare_qs_params</tt><big>(</big><em>request</em>, <em>search_term</em>, <em>search_fields</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelResultJsonMixin.prepare_qs_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelResultJsonMixin.prepare_qs_params" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Prepares queryset parameter to use for searching.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>search_term</strong> (<a class="reference external" href="http://docs.python.org/2.7/library/functions.html#list" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">list</span></tt></a>) – The search term.</li>
|
|
<li><strong>search_fields</strong> – The list of search fields. This is same as <tt class="docutils literal"><span class="pre">self.search_fields</span></tt>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><p>A dictionary of parameters to ‘or’ and ‘and’ together. The output format should
|
|
be</p>
|
|
<div class="highlight-python"><pre>{
|
|
'or': [
|
|
Q(attr11=term11) | Q(attr12=term12) | ...,
|
|
Q(attrN1=termN1) | Q(attrN2=termN2) | ...,
|
|
...],
|
|
|
|
'and': {
|
|
'attrX1': termX1,
|
|
'attrX2': termX2,
|
|
...
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<p>The above would then be coaxed into <tt class="docutils literal"><span class="pre">filter()</span></tt> as below:</p>
|
|
<div class="highlight-python"><pre>queryset.filter(
|
|
Q(attr11=term11) | Q(attr12=term12) | ...,
|
|
Q(attrN1=termN1) | Q(attrN2=termN2) | ...,
|
|
...,
|
|
attrX1=termX1,
|
|
attrX2=termX2,
|
|
...
|
|
)</pre>
|
|
</div>
|
|
<p>In this implementation, <tt class="docutils literal"><span class="pre">term11,</span> <span class="pre">term12,</span> <span class="pre">termN1,</span> <span class="pre">...</span></tt> etc., all are actually <tt class="docutils literal"><span class="pre">search_term</span></tt>.
|
|
Also then <tt class="docutils literal"><span class="pre">and</span></tt> part is always empty.</p>
|
|
<p>So, let’s take an example.</p>
|
|
<div class="line-block">
|
|
<div class="line">Assume, <tt class="docutils literal"><span class="pre">search_term</span> <span class="pre">==</span> <span class="pre">'John'</span></tt></div>
|
|
<div class="line"><tt class="docutils literal"><span class="pre">self.search_fields</span> <span class="pre">==</span> <span class="pre">['first_name__icontains',</span> <span class="pre">'last_name__icontains']</span></tt></div>
|
|
</div>
|
|
<p>So, the prepared query would be:</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
|
|
<span class="s">'or'</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="n">Q</span><span class="p">(</span><span class="n">first_name__icontains</span><span class="o">=</span><span class="n">search_term</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">last_name__icontains</span><span class="o">=</span><span class="n">search_term</span><span class="p">)</span>
|
|
<span class="p">],</span>
|
|
<span class="s">'and'</span><span class="p">:</span> <span class="p">{}</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">dict</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.ModelResultJsonMixin.get_results">
|
|
<tt class="descname">get_results</tt><big>(</big><em>request</em>, <em>term</em>, <em>page</em>, <em>context</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelResultJsonMixin.get_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelResultJsonMixin.get_results" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>See <a class="reference internal" href="ref_views.html#django_select2.views.Select2View.get_results" title="django_select2.views.Select2View.get_results"><tt class="xref py py-meth docutils literal"><span class="pre">views.Select2View.get_results()</span></tt></a>.</p>
|
|
<p>This implementation takes care of detecting if more results are available.</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.UnhideableQuerysetType">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">UnhideableQuerysetType</tt><a class="reference internal" href="_modules/django_select2/fields.html#UnhideableQuerysetType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.UnhideableQuerysetType" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">type</span></tt></p>
|
|
<p>This does some pretty nasty hacky stuff, to make sure users can
|
|
also define <tt class="docutils literal"><span class="pre">queryset</span></tt> as class-level field variable, instead of
|
|
passing it to constructor.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.ChoiceMixin">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">ChoiceMixin</tt><a class="reference internal" href="_modules/django_select2/fields.html#ChoiceMixin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ChoiceMixin" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
|
|
<p>Simple mixin which provides a property – <tt class="docutils literal"><span class="pre">choices</span></tt>. When <tt class="docutils literal"><span class="pre">choices</span></tt> is set,
|
|
then it sets that value to <tt class="docutils literal"><span class="pre">self.widget.choices</span></tt> too.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.QuerysetChoiceMixin">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">QuerysetChoiceMixin</tt><a class="reference internal" href="_modules/django_select2/fields.html#QuerysetChoiceMixin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.QuerysetChoiceMixin" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.ChoiceMixin" title="django_select2.fields.ChoiceMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ChoiceMixin</span></tt></a></p>
|
|
<p>Overrides <tt class="docutils literal"><span class="pre">choices</span></tt>‘ getter to return instance of <tt class="xref py py-class docutils literal"><span class="pre">ModelChoiceIterator</span></tt>
|
|
instead.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.ModelSelect2Field">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">ModelSelect2Field</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelSelect2Field"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelSelect2Field" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelChoiceField</span></tt></p>
|
|
<p>Light Select2 field, specialized for Models.</p>
|
|
<p>Select2 replacement for <tt class="xref py py-class docutils literal"><span class="pre">forms.ModelChoiceField</span></tt>.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.ModelSelect2Field.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.ModelSelect2Field.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">Select2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.ModelSelect2MultipleField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">ModelSelect2MultipleField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#ModelSelect2MultipleField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.ModelSelect2MultipleField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelMultipleChoiceField</span></tt></p>
|
|
<p>Light multiple-value Select2 field, specialized for Models.</p>
|
|
<p>Select2 replacement for <tt class="xref py py-class docutils literal"><span class="pre">forms.ModelMultipleChoiceField</span></tt>.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.ModelSelect2MultipleField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.ModelSelect2MultipleField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">Select2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavySelect2FieldBaseMixin">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavySelect2FieldBaseMixin</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
|
|
<p>Base mixin field for all Heavy fields.</p>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p>Although Heavy fields accept <tt class="docutils literal"><span class="pre">choices</span></tt> parameter like all Django choice fields, but these
|
|
fields are backed by big data sources, so <tt class="docutils literal"><span class="pre">choices</span></tt> cannot possibly have all the values.</p>
|
|
<p class="last">For Heavies, consider <tt class="docutils literal"><span class="pre">choices</span></tt> to be a subset of all possible choices. It is available because users
|
|
might expect it to be available.</p>
|
|
</div>
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.HeavySelect2FieldBaseMixin.__init__">
|
|
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavySelect2FieldBaseMixin.__init__" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Class constructor.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
|
<li><strong>data_view</strong> (<tt class="xref py py-class docutils literal"><span class="pre">django.views.generic.View</span></tt> or None) – A <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> sub-class which can respond to this widget’s Ajax queries.</li>
|
|
<li><strong>widget</strong> (<tt class="xref py py-class docutils literal"><span class="pre">django.forms.widgets.Widget</span></tt> or None) – A widget instance.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition warning">
|
|
<p class="first admonition-title">Warning</p>
|
|
<p class="last">Either of <tt class="docutils literal"><span class="pre">data_view</span></tt> or <tt class="docutils literal"><span class="pre">widget</span></tt> must be specified, else <tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt> would
|
|
be raised.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavyChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavyChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavyChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.ChoiceMixin" title="django_select2.fields.ChoiceMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ChoiceMixin</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">django.forms.fields.Field</span></tt></p>
|
|
<p>Reimplements <a class="reference external" href="http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.TypedChoiceField" title="(in Django v1.5)"><tt class="xref py py-class docutils literal"><span class="pre">django.forms.TypedChoiceField</span></tt></a> in a way which suites the use of big data.</p>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Although this field accepts <tt class="docutils literal"><span class="pre">choices</span></tt> parameter like all Django choice fields, but these
|
|
fields are backed by big data sources, so <tt class="docutils literal"><span class="pre">choices</span></tt> cannot possibly have all the values. It is meant
|
|
to be a subset of all possible choices.</p>
|
|
</div>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavyChoiceField.empty_value">
|
|
<tt class="descname">empty_value</tt><em class="property"> = u''</em><a class="headerlink" href="#django_select2.fields.HeavyChoiceField.empty_value" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sub-classes can set this other value if needed.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.HeavyChoiceField.coerce_value">
|
|
<tt class="descname">coerce_value</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavyChoiceField.coerce_value" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Coerces <tt class="docutils literal"><span class="pre">value</span></tt> to a Python data type.</p>
|
|
<p>Sub-classes should override this if they do not want unicode values.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.HeavyChoiceField.validate_value">
|
|
<tt class="descname">validate_value</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavyChoiceField.validate_value" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sub-classes can override this to validate the value entered against the big data.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (As coerced by <a class="reference internal" href="#django_select2.fields.HeavyChoiceField.coerce_value" title="django_select2.fields.HeavyChoiceField.coerce_value"><tt class="xref py py-meth docutils literal"><span class="pre">coerce_value()</span></tt></a>.) – Value entered by the user.</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">True</span></tt> means the <tt class="docutils literal"><span class="pre">value</span></tt> is valid.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="django_select2.fields.HeavyChoiceField.get_val_txt">
|
|
<tt class="descname">get_val_txt</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavyChoiceField.get_val_txt" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>If Heavy widgets encounter any value which it can’t find in <tt class="docutils literal"><span class="pre">choices</span></tt> then it calls
|
|
this method to get the label for the value.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (As coerced by <a class="reference internal" href="#django_select2.fields.HeavyChoiceField.coerce_value" title="django_select2.fields.HeavyChoiceField.coerce_value"><tt class="xref py py-meth docutils literal"><span class="pre">coerce_value()</span></tt></a>.) – Value entered by the user.</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The label for this value.</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/2.7/library/functions.html#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a> or None (when no possible label could be found)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavyMultipleChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavyMultipleChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#django_select2.fields.HeavyMultipleChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.HeavyChoiceField" title="django_select2.fields.HeavyChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavyChoiceField</span></tt></a></p>
|
|
<p>Reimplements <a class="reference external" href="http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.TypedMultipleChoiceField" title="(in Django v1.5)"><tt class="xref py py-class docutils literal"><span class="pre">django.forms.TypedMultipleChoiceField</span></tt></a> in a way which suites the use of big data.</p>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Although this field accepts <tt class="docutils literal"><span class="pre">choices</span></tt> parameter like all Django choice fields, but these
|
|
fields are backed by big data sources, so <tt class="docutils literal"><span class="pre">choices</span></tt> cannot possibly have all the values. It is meant
|
|
to be a subset of all possible choices.</p>
|
|
</div>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavyMultipleChoiceField.hidden_widget">
|
|
<tt class="descname">hidden_widget</tt><a class="headerlink" href="#django_select2.fields.HeavyMultipleChoiceField.hidden_widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">MultipleHiddenInput</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavySelect2ChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavySelect2ChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#HeavySelect2ChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.HeavySelect2ChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="django_select2.fields.HeavySelect2FieldBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2FieldBaseMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavyChoiceField" title="django_select2.fields.HeavyChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavyChoiceField</span></tt></a></p>
|
|
<p>Heavy Select2 Choice field.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavySelect2ChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.HeavySelect2ChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavySelect2MultipleChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavySelect2MultipleChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#HeavySelect2MultipleChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.HeavySelect2MultipleChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="django_select2.fields.HeavySelect2FieldBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2FieldBaseMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavyMultipleChoiceField" title="django_select2.fields.HeavyMultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavyMultipleChoiceField</span></tt></a></p>
|
|
<p>Heavy Select2 Multiple Choice field.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavySelect2MultipleChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.HeavySelect2MultipleChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavyModelSelect2ChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavyModelSelect2ChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#HeavyModelSelect2ChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="django_select2.fields.HeavySelect2FieldBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2FieldBaseMixin</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelChoiceField</span></tt></p>
|
|
<p>Heavy Select2 Choice field, specialized for Models.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavyModelSelect2ChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.HeavyModelSelect2ChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.HeavyModelSelect2MultipleChoiceField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">HeavyModelSelect2MultipleChoiceField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#HeavyModelSelect2MultipleChoiceField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.HeavySelect2FieldBaseMixin" title="django_select2.fields.HeavySelect2FieldBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2FieldBaseMixin</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelMultipleChoiceField</span></tt></p>
|
|
<p>Heavy Select2 Multiple Choice field, specialized for Models.</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.HeavyModelSelect2MultipleChoiceField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">HeavySelect2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.AutoSelect2Field">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">AutoSelect2Field</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoSelect2Field"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoSelect2Field" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.AutoViewFieldMixin" title="django_select2.fields.AutoViewFieldMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.AutoViewFieldMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavySelect2ChoiceField" title="django_select2.fields.HeavySelect2ChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2ChoiceField</span></tt></a></p>
|
|
<p>Auto Heavy Select2 field.</p>
|
|
<p>This needs to be subclassed. The first instance of a class (sub-class) is used to serve all incoming
|
|
json query requests for that type (class).</p>
|
|
<div class="admonition warning">
|
|
<p class="first admonition-title">Warning</p>
|
|
<p class="last"><tt class="xref py py-exc docutils literal"><span class="pre">NotImplementedError</span></tt> would be thrown if <tt class="xref py py-meth docutils literal"><span class="pre">get_results()</span></tt> is not implemented.</p>
|
|
</div>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.AutoSelect2Field.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.AutoSelect2Field.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.AutoSelect2MultipleField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">AutoSelect2MultipleField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoSelect2MultipleField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoSelect2MultipleField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.AutoViewFieldMixin" title="django_select2.fields.AutoViewFieldMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.AutoViewFieldMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavySelect2MultipleChoiceField" title="django_select2.fields.HeavySelect2MultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavySelect2MultipleChoiceField</span></tt></a></p>
|
|
<p>Auto Heavy Select2 field for multiple choices.</p>
|
|
<p>This needs to be subclassed. The first instance of a class (sub-class) is used to serve all incoming
|
|
json query requests for that type (class).</p>
|
|
<div class="admonition warning">
|
|
<p class="first admonition-title">Warning</p>
|
|
<p class="last"><tt class="xref py py-exc docutils literal"><span class="pre">NotImplementedError</span></tt> would be thrown if <tt class="xref py py-meth docutils literal"><span class="pre">get_results()</span></tt> is not implemented.</p>
|
|
</div>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.AutoSelect2MultipleField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.AutoSelect2MultipleField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.AutoModelSelect2Field">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">AutoModelSelect2Field</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoModelSelect2Field"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoModelSelect2Field" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.ModelResultJsonMixin" title="django_select2.fields.ModelResultJsonMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelResultJsonMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.AutoViewFieldMixin" title="django_select2.fields.AutoViewFieldMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.AutoViewFieldMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavyModelSelect2ChoiceField" title="django_select2.fields.HeavyModelSelect2ChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavyModelSelect2ChoiceField</span></tt></a></p>
|
|
<p>Auto Heavy Select2 field, specialized for Models.</p>
|
|
<p>This needs to be subclassed. The first instance of a class (sub-class) is used to serve all incoming
|
|
json query requests for that type (class).</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.AutoModelSelect2Field.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.AutoModelSelect2Field.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2Widget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.fields.AutoModelSelect2MultipleField">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.fields.</tt><tt class="descname">AutoModelSelect2MultipleField</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/fields.html#AutoModelSelect2MultipleField"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.fields.AutoModelSelect2MultipleField" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.fields.ModelResultJsonMixin" title="django_select2.fields.ModelResultJsonMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.ModelResultJsonMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.AutoViewFieldMixin" title="django_select2.fields.AutoViewFieldMixin"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.AutoViewFieldMixin</span></tt></a>, <a class="reference internal" href="#django_select2.fields.HeavyModelSelect2MultipleChoiceField" title="django_select2.fields.HeavyModelSelect2MultipleChoiceField"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.fields.HeavyModelSelect2MultipleChoiceField</span></tt></a></p>
|
|
<p>Auto Heavy Select2 field for multiple choices, specialized for Models.</p>
|
|
<p>This needs to be subclassed. The first instance of a class (sub-class) is used to serve all incoming
|
|
json query requests for that type (class).</p>
|
|
<dl class="attribute">
|
|
<dt id="django_select2.fields.AutoModelSelect2MultipleField.widget">
|
|
<tt class="descname">widget</tt><a class="headerlink" href="#django_select2.fields.AutoModelSelect2MultipleField.widget" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">AutoHeavySelect2MultipleWidget</span></tt></p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="ref_widgets.html"
|
|
title="previous chapter">Widgets</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="ref_views.html"
|
|
title="next chapter">Views</a></p>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/ref_fields.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="ref_views.html" title="Views"
|
|
>next</a> |</li>
|
|
<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> »</li>
|
|
<li><a href="reference.html" >API Reference</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2012, Nirupam Biswas.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
|
</div>
|
|
</body>
|
|
</html> |