Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 22, 2024
1 parent a7a74f9 commit 1f73fd3
Show file tree
Hide file tree
Showing 10 changed files with 378 additions and 9 deletions.
182 changes: 182 additions & 0 deletions _modules/apis_core/generic/forms/widgets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apis_core.generic.forms.widgets &mdash; APIS 1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../../../_static/documentation_options.js?v=f2a433a1"></script>
<script src="../../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../../../index.html" class="icon icon-home">
APIS
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Documentation:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../installation.html">Installation with Docker</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../installation.html#installation-without-docker">Installation without Docker</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../settings.html">Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../customization.html">Customization</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../user_documentation.html">User documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../data_model.html">Data Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../development.html">Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../collections.html">Working with collections</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../autocomplete.html">Extending autocomplete results</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../importing.html">Importing data from external resources</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Internals:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../genindex.html">Index</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../py-modindex.html">Module Index</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../index.html">APIS</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../../index.html">Module code</a></li>
<li class="breadcrumb-item"><a href="../forms.html">apis_core.generic.forms</a></li>
<li class="breadcrumb-item active">apis_core.generic.forms.widgets</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for apis_core.generic.forms.widgets</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">json</span>
<span class="kn">from</span> <span class="nn">django.forms.widgets</span> <span class="kn">import</span> <span class="n">Input</span>


<div class="viewcode-block" id="NewlineSeparatedListWidget">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.NewlineSeparatedListWidget">[docs]</a>
<span class="k">class</span> <span class="nc">NewlineSeparatedListWidget</span><span class="p">(</span><span class="n">Input</span><span class="p">):</span>
<span class="n">input_type</span> <span class="o">=</span> <span class="s2">&quot;text&quot;</span>
<span class="n">template_name</span> <span class="o">=</span> <span class="s2">&quot;widgets/multiline.html&quot;</span>

<div class="viewcode-block" id="NewlineSeparatedListWidget.Media">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.NewlineSeparatedListWidget.Media">[docs]</a>
<span class="k">class</span> <span class="nc">Media</span><span class="p">:</span>
<span class="n">js</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;js/multiline.js&quot;</span><span class="p">]</span></div>


<div class="viewcode-block" id="NewlineSeparatedListWidget.value_from_datadict">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.NewlineSeparatedListWidget.value_from_datadict">[docs]</a>
<span class="k">def</span> <span class="nf">value_from_datadict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">files</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="n">values</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">getlist</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">item</span><span class="p">]</span>
<span class="k">return</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">values</span><span class="p">)</span></div>


<div class="viewcode-block" id="NewlineSeparatedListWidget.format_value">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.NewlineSeparatedListWidget.format_value">[docs]</a>
<span class="k">def</span> <span class="nf">format_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="k">if</span> <span class="n">value</span> <span class="o">==</span> <span class="s2">&quot;&quot;</span> <span class="ow">or</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">return</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span></div>
</div>



<div class="viewcode-block" id="JSONListWidget">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.JSONListWidget">[docs]</a>
<span class="k">class</span> <span class="nc">JSONListWidget</span><span class="p">(</span><span class="n">Input</span><span class="p">):</span>
<span class="n">input_type</span> <span class="o">=</span> <span class="s2">&quot;text&quot;</span>
<span class="n">template_name</span> <span class="o">=</span> <span class="s2">&quot;widgets/multiline.html&quot;</span>

<div class="viewcode-block" id="JSONListWidget.Media">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.JSONListWidget.Media">[docs]</a>
<span class="k">class</span> <span class="nc">Media</span><span class="p">:</span>
<span class="n">js</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;js/multiline.js&quot;</span><span class="p">]</span></div>


<div class="viewcode-block" id="JSONListWidget.value_from_datadict">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.JSONListWidget.value_from_datadict">[docs]</a>
<span class="k">def</span> <span class="nf">value_from_datadict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">files</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="n">values</span> <span class="o">=</span> <span class="p">[</span><span class="n">item</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">getlist</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">item</span><span class="p">]</span>
<span class="k">return</span> <span class="n">values</span></div>


<div class="viewcode-block" id="JSONListWidget.format_value">
<a class="viewcode-back" href="../../../../modules/apis_core.generic.forms.html#apis_core.generic.forms.widgets.JSONListWidget.format_value">[docs]</a>
<span class="k">def</span> <span class="nf">format_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="k">if</span> <span class="n">value</span> <span class="o">==</span> <span class="s2">&quot;&quot;</span> <span class="ow">or</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">value</span><span class="p">)</span></div>
</div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2021, Matthias Schlögl.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
1 change: 1 addition & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ <h1>All modules for which code is available</h1>
<li><a href="apis_core/generic/filtersets.html">apis_core.generic.filtersets</a></li>
<li><a href="apis_core/generic/forms.html">apis_core.generic.forms</a></li>
<ul><li><a href="apis_core/generic/forms/fields.html">apis_core.generic.forms.fields</a></li>
<li><a href="apis_core/generic/forms/widgets.html">apis_core.generic.forms.widgets</a></li>
</ul><li><a href="apis_core/generic/helpers.html">apis_core.generic.helpers</a></li>
<li><a href="apis_core/generic/importers.html">apis_core.generic.importers</a></li>
<li><a href="apis_core/generic/serializers.html">apis_core.generic.serializers</a></li>
Expand Down
8 changes: 8 additions & 0 deletions _sources/modules/apis_core.generic.forms.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ apis\_core.generic.forms.fields module
:members:
:undoc-members:
:show-inheritance:

apis\_core.generic.forms.widgets module
---------------------------------------

.. automodule:: apis_core.generic.forms.widgets
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 1f73fd3

Please sign in to comment.