Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 4, 2024
1 parent 370af25 commit f69062a
Show file tree
Hide file tree
Showing 113 changed files with 1,726 additions and 314 deletions.
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/abc.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apis_core.apis_metainfo.serializers &mdash; APIS 1.0 documentation</title>
<title>apis_core.apis_entities.api_renderers &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" />

Expand All @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down Expand Up @@ -80,7 +80,7 @@
<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 active">apis_core.apis_metainfo.serializers</li>
<li class="breadcrumb-item active">apis_core.apis_entities.api_renderers</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
Expand All @@ -89,26 +89,18 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for apis_core.apis_metainfo.serializers</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">rest_framework</span> <span class="kn">import</span> <span class="n">serializers</span>

<span class="kn">from</span> <span class="nn">.models</span> <span class="kn">import</span> <span class="n">Uri</span>

<span class="kn">from</span> <span class="nn">apis_core.generic.serializers</span> <span class="kn">import</span> <span class="n">GenericHyperlinkedModelSerializer</span>


<div class="viewcode-block" id="UriSerializer">
<a class="viewcode-back" href="../../../modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.serializers.UriSerializer">[docs]</a>
<span class="k">class</span> <span class="nc">UriSerializer</span><span class="p">(</span><span class="n">GenericHyperlinkedModelSerializer</span><span class="p">):</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">serializers</span><span class="o">.</span><span class="n">HyperlinkedIdentityField</span><span class="p">(</span>
<span class="n">view_name</span><span class="o">=</span><span class="s2">&quot;apis:apis_api:uri-detail&quot;</span><span class="p">,</span> <span class="n">lookup_field</span><span class="o">=</span><span class="s2">&quot;pk&quot;</span>
<span class="p">)</span>

<div class="viewcode-block" id="UriSerializer.Meta">
<a class="viewcode-back" href="../../../modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.serializers.UriSerializer.Meta">[docs]</a>
<span class="k">class</span> <span class="nc">Meta</span><span class="p">:</span>
<span class="n">fields</span> <span class="o">=</span> <span class="s2">&quot;__all__&quot;</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">Uri</span></div>
<h1>Source code for apis_core.apis_entities.api_renderers</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">apis_core.utils.renderers.tei</span> <span class="kn">import</span> <span class="n">TeiRenderer</span>


<div class="viewcode-block" id="EntityToTEI">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_renderers.EntityToTEI">[docs]</a>
<span class="k">class</span> <span class="nc">EntityToTEI</span><span class="p">(</span><span class="n">TeiRenderer</span><span class="p">):</span>
<div class="viewcode-block" id="EntityToTEI.render">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_renderers.EntityToTEI.render">[docs]</a>
<span class="k">def</span> <span class="nf">render</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">media_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">renderer_context</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template_name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;apis_entities/tei/</span><span class="si">{</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;entity_type&#39;</span><span class="p">]</span><span class="si">}</span><span class="s2">.xml&quot;</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">media_type</span><span class="p">,</span> <span class="n">renderer_context</span><span class="p">)</span></div>
</div>

</pre></div>
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/api_views.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
64 changes: 63 additions & 1 deletion _modules/apis_core/apis_entities/autocomplete3.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down Expand Up @@ -106,6 +106,68 @@ <h1>Source code for apis_core.apis_entities.autocomplete3</h1><div class="highli
<span class="kn">from</span> <span class="nn">apis_core.utils.settings</span> <span class="kn">import</span> <span class="n">get_entity_settings_by_modelname</span>


<div class="viewcode-block" id="CustomEntityAutocompletes">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.autocomplete3.CustomEntityAutocompletes">[docs]</a>
<span class="k">class</span> <span class="nc">CustomEntityAutocompletes</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;A class for collecting all the custom autocomplete functions for one entity.</span>

<span class="sd"> Attributes:</span>

<span class="sd"> - self.entity: (string) entity types</span>
<span class="sd"> - self.more: (boolean) if more results can be fetched (pagination)</span>
<span class="sd"> - self.page_size: (integer) page size</span>
<span class="sd"> - self.results: (list) results</span>
<span class="sd"> - self.query: (string) query string</span>

<span class="sd"> Methods:</span>
<span class="sd"> - self.more(): fetch more results</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entity</span><span class="p">,</span> <span class="n">query</span><span class="p">,</span> <span class="n">page_size</span><span class="o">=</span><span class="mi">20</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :param entity: (string) entity type to fetch additional autocompletes for</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">func_list</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">if</span> <span class="n">entity</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">func_list</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="bp">self</span><span class="o">.</span><span class="n">results</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">res</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">more</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
<span class="n">more_gen</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">func_list</span><span class="p">[</span><span class="n">entity</span><span class="p">]:</span>
<span class="n">res2</span> <span class="o">=</span> <span class="n">x</span><span class="p">()</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">page_size</span><span class="p">,</span> <span class="n">offset</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">res2</span><span class="p">)</span> <span class="o">==</span> <span class="n">page_size</span><span class="p">:</span>
<span class="n">more</span><span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="vm">__name__</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="n">offset</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">more_gen</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">res</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">res2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">results</span> <span class="o">=</span> <span class="n">res</span>
<span class="bp">self</span><span class="o">.</span><span class="n">page_size</span> <span class="o">=</span> <span class="n">page_size</span>
<span class="bp">self</span><span class="o">.</span><span class="n">more</span> <span class="o">=</span> <span class="n">more_gen</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_more_dict</span> <span class="o">=</span> <span class="n">more</span>
<span class="bp">self</span><span class="o">.</span><span class="n">query</span> <span class="o">=</span> <span class="n">query</span>
<span class="bp">self</span><span class="o">.</span><span class="n">offset</span> <span class="o">=</span> <span class="n">offset</span>

<div class="viewcode-block" id="CustomEntityAutocompletes.get_more">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.autocomplete3.CustomEntityAutocompletes.get_more">[docs]</a>
<span class="k">def</span> <span class="nf">get_more</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Function to retrieve more results.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">res4</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_more_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="k">if</span> <span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">res3</span> <span class="o">=</span> <span class="nb">globals</span><span class="p">()[</span><span class="n">key</span><span class="p">](</span><span class="bp">self</span><span class="o">.</span><span class="n">query</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">page_size</span><span class="p">,</span> <span class="n">value</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">res3</span><span class="p">)</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">page_size</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_more_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="kc">True</span><span class="p">,</span> <span class="n">value</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_more_dict</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="kc">False</span><span class="p">,</span> <span class="n">value</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">res3</span><span class="p">)</span>
<span class="n">res4</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">res3</span><span class="p">)</span>
<span class="k">return</span> <span class="n">res4</span></div>
</div>



<span class="c1"># TODO RDF: Check if this should be removed or adapted</span>
<div class="viewcode-block" id="GenericNetworkEntitiesAutocomplete">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.autocomplete3.GenericNetworkEntitiesAutocomplete">[docs]</a>
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/filtersets.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_entities/serializers.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<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=9a2dae69"></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" />
Expand Down
Loading

0 comments on commit f69062a

Please sign in to comment.