Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 30, 2023
1 parent 22e6fbb commit 9ab36fc
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,38 +85,7 @@
<div itemprop="articleBody">

<h1>Source code for apis_core.context_processors.custom_context_processors</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">operator</span> <span class="kn">import</span> <span class="n">itemgetter</span>

<span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>

<span class="kn">from</span> <span class="nn">apis_core.utils</span> <span class="kn">import</span> <span class="n">caching</span>


<div class="viewcode-block" id="list_entities">
<a class="viewcode-back" href="../../../modules/apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_entities">[docs]</a>
<span class="k">def</span> <span class="nf">list_entities</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Retrieve all models which inherit from AbstractEntity class</span>
<span class="sd"> and make information about them available on the frontend.</span>

<span class="sd"> :return a dictionary of context items</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">entities_classes</span> <span class="o">=</span> <span class="n">caching</span><span class="o">.</span><span class="n">get_all_entity_classes</span><span class="p">()</span> <span class="ow">or</span> <span class="p">[]</span>
<span class="c1"># create (uri, label) tuples for entities for use in templates</span>
<span class="n">entities_links</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="vm">__name__</span><span class="o">.</span><span class="n">lower</span><span class="p">(),</span> <span class="n">e</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">verbose_name</span><span class="o">.</span><span class="n">title</span><span class="p">())</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">entities_classes</span>
<span class="p">]</span>
<span class="n">entities_links</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="n">itemgetter</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>

<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;entities_links&quot;</span><span class="p">:</span> <span class="n">entities_links</span><span class="p">,</span> <span class="s2">&quot;request&quot;</span><span class="p">:</span> <span class="n">request</span><span class="p">}</span></div>



<div class="viewcode-block" id="list_relations">
<a class="viewcode-back" href="../../../modules/apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_relations">[docs]</a>
<span class="k">def</span> <span class="nf">list_relations</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;relations_list&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;property&quot;</span><span class="p">,</span> <span class="s2">&quot;triple&quot;</span><span class="p">],</span> <span class="s2">&quot;request&quot;</span><span class="p">:</span> <span class="n">request</span><span class="p">}</span></div>

<span></span><span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>


<div class="viewcode-block" id="list_apis_settings">
Expand Down
8 changes: 2 additions & 6 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1713,11 +1713,11 @@ <h2 id="L">L</h2>
<li><a href="modules/apis_core.apis_relations.html#apis_core.apis_relations.tables.LabelTableBase">LabelTableBase (class in apis_core.apis_relations.tables)</a>
</li>
<li><a href="modules/apis_core.apis_relations.html#apis_core.apis_relations.tables.LabelTableBase.Meta">LabelTableBase.Meta (class in apis_core.apis_relations.tables)</a>
</li>
<li><a href="modules/apis_core.apis_relations.html#apis_core.apis_relations.tables.LabelTableEdit">LabelTableEdit (class in apis_core.apis_relations.tables)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/apis_core.apis_relations.html#apis_core.apis_relations.tables.LabelTableEdit">LabelTableEdit (class in apis_core.apis_relations.tables)</a>
</li>
<li><a href="modules/apis_core.apis_relations.html#apis_core.apis_relations.tables.LabelTableEdit.Meta">LabelTableEdit.Meta (class in apis_core.apis_relations.tables)</a>
</li>
<li><a href="modules/apis_core.apis_vocabularies.html#apis_core.apis_vocabularies.models.VocabsBaseClass.labeltype">labeltype (apis_core.apis_vocabularies.models.VocabsBaseClass attribute)</a>
Expand All @@ -1744,13 +1744,9 @@ <h2 id="L">L</h2>
<li><a href="modules/apis_core.apis_vocabularies.html#apis_core.apis_vocabularies.admin.VocabsRelationAdmin.list_display">(apis_core.apis_vocabularies.admin.VocabsRelationAdmin attribute)</a>
</li>
</ul></li>
<li><a href="modules/apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_entities">list_entities() (in module apis_core.context_processors.custom_context_processors)</a>
</li>
<li><a href="modules/apis_core.apis_labels.html#apis_core.apis_labels.admin.BaseAdmin.list_filter">list_filter (apis_core.apis_labels.admin.BaseAdmin attribute)</a>
</li>
<li><a href="modules/apis_core.utils.html#apis_core.utils.settings.list_links_to_edit">list_links_to_edit() (in module apis_core.utils.settings)</a>
</li>
<li><a href="modules/apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_relations">list_relations() (in module apis_core.context_processors.custom_context_processors)</a>
</li>
<li><a href="modules/apis_core.apis_entities.html#apis_core.apis_entities.fields.ListSelect2">ListSelect2 (class in apis_core.apis_entities.fields)</a>
</li>
Expand Down
13 changes: 0 additions & 13 deletions modules/apis_core.context_processors.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
<dd><p>adds the custom settings to the templates</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="apis_core.context_processors.custom_context_processors.list_entities">
<span class="sig-prename descclassname"><span class="pre">apis_core.context_processors.custom_context_processors.</span></span><span class="sig-name descname"><span class="pre">list_entities</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apis_core/context_processors/custom_context_processors.html#list_entities"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apis_core.context_processors.custom_context_processors.list_entities" title="Link to this definition"></a></dt>
<dd><p>Retrieve all models which inherit from AbstractEntity class
and make information about them available on the frontend.</p>
<p>:return a dictionary of context items</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="apis_core.context_processors.custom_context_processors.list_relations">
<span class="sig-prename descclassname"><span class="pre">apis_core.context_processors.custom_context_processors.</span></span><span class="sig-name descname"><span class="pre">list_relations</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apis_core/context_processors/custom_context_processors.html#list_relations"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apis_core.context_processors.custom_context_processors.list_relations" title="Link to this definition"></a></dt>
<dd></dd></dl>

</section>
</section>

Expand Down
2 changes: 0 additions & 2 deletions modules/apis_core.html
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,6 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
<li class="toctree-l2"><a class="reference internal" href="apis_core.context_processors.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="apis_core.context_processors.html#module-apis_core.context_processors.custom_context_processors">apis_core.context_processors.custom_context_processors module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_apis_settings"><code class="docutils literal notranslate"><span class="pre">list_apis_settings()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_entities"><code class="docutils literal notranslate"><span class="pre">list_entities()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="apis_core.context_processors.html#apis_core.context_processors.custom_context_processors.list_relations"><code class="docutils literal notranslate"><span class="pre">list_relations()</span></code></a></li>
</ul>
</li>
</ul>
Expand Down
Binary file modified objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 9ab36fc

Please sign in to comment.