mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-19 23:00:24 +00:00
360 lines
No EOL
26 KiB
HTML
360 lines
No EOL
26 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>Util — Django-Select2 3.1.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.1.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.1.2 documentation" href="index.html" />
|
|
<link rel="up" title="API Reference" href="reference.html" />
|
|
<link rel="prev" title="Views" href="ref_views.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="P">previous</a> |</li>
|
|
<li><a href="index.html">Django-Select2 3.1.2 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="util">
|
|
<h1>Util<a class="headerlink" href="#util" title="Permalink to this headline">¶</a></h1>
|
|
<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-b1d6d9e7c478c7dc16ac802dba655251d1a9f594.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.JSFunction" title="JSFunction" alt="" coords="127,105,124,100,115,95,101,92,84,89,65,88,46,89,29,92,16,95,7,100,4,105,7,111,16,115,29,119,46,121,65,122,84,121,101,119,115,115,124,111"/>
|
|
<area shape="poly" id="node2" href="#django_select2.util.JSVar" title="JSVar" alt="" coords="199,23,197,17,191,13,183,9,172,7,160,6,148,7,137,9,129,13,123,17,121,23,123,28,129,33,137,36,148,39,160,40,172,39,183,36,191,33,197,28"/>
|
|
<area shape="poly" id="node4" href="#django_select2.util.JSFunctionInContext" title="JSFunctionInContext" alt="" coords="358,105,353,100,339,95,316,92,287,89,255,88,223,89,194,92,171,95,156,100,151,105,156,111,171,115,194,119,223,121,255,122,287,121,316,119,339,115,353,111"/>
|
|
</map>
|
|
</p>
|
|
</div>
|
|
<div class="section" id="module-django_select2.util">
|
|
<span id="reference"></span><h2>Reference<a class="headerlink" href="#module-django_select2.util" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="django_select2.util.JSVar">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.util.</tt><tt class="descname">JSVar</tt><a class="reference internal" href="_modules/django_select2/util.html#JSVar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.JSVar" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt></p>
|
|
<p>A JS variable.</p>
|
|
<p>This is a simple unicode string. This class type acts as a marker that this string is a JS variable name,
|
|
so it must not be quoted by <a class="reference internal" href="#django_select2.util.convert_py_to_js_data" title="django_select2.util.convert_py_to_js_data"><tt class="xref py py-func docutils literal"><span class="pre">convert_py_to_js_data()</span></tt></a> while rendering the JS code.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.util.JSFunction">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.util.</tt><tt class="descname">JSFunction</tt><a class="reference internal" href="_modules/django_select2/util.html#JSFunction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.JSFunction" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.util.JSVar" title="django_select2.util.JSVar"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.util.JSVar</span></tt></a></p>
|
|
<p>A JS function name.</p>
|
|
<p>From rendering point of view, rendering this is no different from <a class="reference internal" href="#django_select2.util.JSVar" title="django_select2.util.JSVar"><tt class="xref py py-class docutils literal"><span class="pre">JSVar</span></tt></a>. After all, a JS varible
|
|
can refer a function instance, primitive constant or any other object. They are still all varibles.</p>
|
|
<div class="admonition tip">
|
|
<p class="first admonition-title">Tip</p>
|
|
<p class="last">Do use this marker for JS functions. This will make the code clearer, and the purpose more easier to
|
|
understand.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="django_select2.util.JSFunctionInContext">
|
|
<em class="property">class </em><tt class="descclassname">django_select2.util.</tt><tt class="descname">JSFunctionInContext</tt><a class="reference internal" href="_modules/django_select2/util.html#JSFunctionInContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.JSFunctionInContext" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#django_select2.util.JSVar" title="django_select2.util.JSVar"><tt class="xref py py-class docutils literal"><span class="pre">django_select2.util.JSVar</span></tt></a></p>
|
|
<p>A JS function name to run in context of some other Html DOM element.</p>
|
|
<p>Like :py:class:JSFunction`, this too flags the string as JS function, but with a special requirement. The JS function
|
|
needs to be invoked in the context of a Html DOM, such that, <tt class="docutils literal"><span class="pre">this</span></tt> inside the function refers to that DOM instead of
|
|
<tt class="docutils literal"><span class="pre">window</span></tt>.</p>
|
|
<div class="admonition tip">
|
|
<p class="first admonition-title">Tip</p>
|
|
<p class="last">JS functions of this type are warapped inside special another JS function – <tt class="docutils literal"><span class="pre">django_select2.runInContextHelper</span></tt>.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.render_js_script">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">render_js_script</tt><big>(</big><em>inner_code</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#render_js_script"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.render_js_script" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>This wraps <tt class="docutils literal"><span class="pre">inner_code</span></tt> string inside the following code block:</p>
|
|
<div class="highlight-python"><pre><script>
|
|
$(function () {
|
|
// inner_code here
|
|
});
|
|
</script></pre>
|
|
</div>
|
|
<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">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="function">
|
|
<dt id="django_select2.util.extract_some_key_val">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">extract_some_key_val</tt><big>(</big><em>dct</em>, <em>keys</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#extract_some_key_val"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.extract_some_key_val" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Gets a sub-set of 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>.</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>dct</strong> (<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>) – Source dictionary.</li>
|
|
<li><strong>keys</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> or any iterable.) – List of subset keys, which to extract from <tt class="docutils literal"><span class="pre">dct</span></tt>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even 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="function">
|
|
<dt id="django_select2.util.convert_py_to_js_data">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">convert_py_to_js_data</tt><big>(</big><em>val</em>, <em>id_</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#convert_py_to_js_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.convert_py_to_js_data" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Converts Python data type to JS data type.</p>
|
|
<p>Practically what this means is, convert <tt class="docutils literal"><span class="pre">False</span></tt> to <tt class="docutils literal"><span class="pre">false</span></tt>, <tt class="docutils literal"><span class="pre">True</span></tt> to <tt class="docutils literal"><span class="pre">true</span></tt> and so on.
|
|
It also takes care of the conversion of <a class="reference internal" href="#django_select2.util.JSVar" title="django_select2.util.JSVar"><tt class="xref py py-class docutils literal"><span class="pre">JSVar</span></tt></a>, <a class="reference internal" href="#django_select2.util.JSFunction" title="django_select2.util.JSFunction"><tt class="xref py py-class docutils literal"><span class="pre">JSFunction</span></tt></a>
|
|
and <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a>. It takes care of recursively converting lists and dictionaries
|
|
too.</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>val</strong> (<em>Any</em>) – The Python data to convert.</li>
|
|
<li><strong>id</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>) – The DOM id of the element in which context <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a> functions
|
|
should run. (This is not needed if <tt class="docutils literal"><span class="pre">val</span></tt> contains no <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a>)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even 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#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.convert_dict_to_js_map">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">convert_dict_to_js_map</tt><big>(</big><em>dct</em>, <em>id_</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#convert_dict_to_js_map"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.convert_dict_to_js_map" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Converts a Python dictionary to JS map.</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>dct</strong> (<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>) – The Python dictionary to convert.</li>
|
|
<li><strong>id</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>) – The DOM id of the element in which context <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a> functions
|
|
should run. (This is not needed if <tt class="docutils literal"><span class="pre">dct</span></tt> contains no <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a>)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even 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#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.convert_to_js_arr">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">convert_to_js_arr</tt><big>(</big><em>lst</em>, <em>id_</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#convert_to_js_arr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.convert_to_js_arr" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Converts a Python list (or any iterable) to JS array.</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>lst</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> or Any iterable) – The Python iterable to convert.</li>
|
|
<li><strong>id</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>) – The DOM id of the element in which context <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a> functions
|
|
should run. (This is not needed if <tt class="docutils literal"><span class="pre">lst</span></tt> contains no <a class="reference internal" href="#django_select2.util.JSFunctionInContext" title="django_select2.util.JSFunctionInContext"><tt class="xref py py-class docutils literal"><span class="pre">JSFunctionInContext</span></tt></a>)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even 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#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.convert_to_js_string_arr">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">convert_to_js_string_arr</tt><big>(</big><em>lst</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#convert_to_js_string_arr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.convert_to_js_string_arr" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Converts a Python list (or any iterable) of strings to JS array.</p>
|
|
<p><a class="reference internal" href="#django_select2.util.convert_to_js_arr" title="django_select2.util.convert_to_js_arr"><tt class="xref py py-func docutils literal"><span class="pre">convert_to_js_arr()</span></tt></a> can always be used instead of this. However, since it
|
|
knows that it only contains strings, it cuts down on unnecessary computations.</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">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="function">
|
|
<dt id="django_select2.util.synchronized">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">synchronized</tt><big>(</big><em>f</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#synchronized"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.synchronized" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Decorator to synchronize multiple calls to a functions.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.is_valid_id">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">is_valid_id</tt><big>(</big><em>val</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#is_valid_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.is_valid_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Checks if <tt class="docutils literal"><span class="pre">val</span></tt> is a valid generated Id.</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>val</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>) – The value to check.</td>
|
|
</tr>
|
|
<tr class="field-even 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#bool" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">bool</span></tt></a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.register_field">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">register_field</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#register_field"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.register_field" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Registers an Auto field for use with <a class="reference internal" href="ref_views.html#django_select2.views.AutoResponseView" title="django_select2.views.AutoResponseView"><tt class="xref py py-class docutils literal"><span class="pre">views.AutoResponseView</span></tt></a>.</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>key</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>) – The key to use while registering this field.</li>
|
|
<li><strong>field</strong> (<tt class="xref py py-class docutils literal"><span class="pre">AutoViewFieldMixin</span></tt>) – The field to register.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The generated Id for this field. If given <tt class="docutils literal"><span class="pre">key</span></tt> was already registered then the
|
|
Id generated that time, would be returned.</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#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="django_select2.util.get_field">
|
|
<tt class="descclassname">django_select2.util.</tt><tt class="descname">get_field</tt><big>(</big><em>id_</em><big>)</big><a class="reference internal" href="_modules/django_select2/util.html#get_field"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django_select2.util.get_field" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns an Auto field instance registered with the given Id.</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>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>) – The generated Id the field is registered with.</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><tt class="xref py py-class docutils literal"><span class="pre">AutoViewFieldMixin</span></tt> or None</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
</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="#">Util</a><ul>
|
|
<li><a class="reference internal" href="#class-diagram">Class Diagram</a></li>
|
|
<li><a class="reference internal" href="#module-django_select2.util">Reference</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="ref_views.html"
|
|
title="previous chapter">Views</a></p>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/ref_util.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"
|
|
>previous</a> |</li>
|
|
<li><a href="index.html">Django-Select2 3.1.2 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> |