Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 27, 2024
1 parent 90777e0 commit 4ed865e
Show file tree
Hide file tree
Showing 13 changed files with 429 additions and 8 deletions.
22 changes: 22 additions & 0 deletions _modules/apis_core/apis_entities/api_views.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@

<h1>Source code for apis_core.apis_entities.api_views</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">django.shortcuts</span> <span class="kn">import</span> <span class="n">redirect</span>
<span class="kn">from</span> <span class="nn">django.db.models</span> <span class="kn">import</span> <span class="n">Q</span>
<span class="kn">from</span> <span class="nn">rest_framework.views</span> <span class="kn">import</span> <span class="n">APIView</span>
<span class="kn">from</span> <span class="nn">rest_framework.exceptions</span> <span class="kn">import</span> <span class="n">NotFound</span>
<span class="kn">from</span> <span class="nn">rest_framework.generics</span> <span class="kn">import</span> <span class="n">ListAPIView</span>

<span class="kn">from</span> <span class="nn">apis_core.apis_metainfo.models</span> <span class="kn">import</span> <span class="n">RootObject</span>
<span class="kn">from</span> <span class="nn">apis_core.apis_entities.serializers</span> <span class="kn">import</span> <span class="n">MinimalEntitySerializer</span>
<span class="kn">from</span> <span class="nn">apis_core.apis_entities.utils</span> <span class="kn">import</span> <span class="n">get_entity_classes</span>


<div class="viewcode-block" id="GetEntityGeneric">
Expand All @@ -110,6 +114,24 @@ <h1>Source code for apis_core.apis_entities.api_views</h1><div class="highlight"
<span class="k">raise</span> <span class="n">NotFound</span></div>
</div>



<div class="viewcode-block" id="ListEntityGeneric">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_views.ListEntityGeneric">[docs]</a>
<span class="k">class</span> <span class="nc">ListEntityGeneric</span><span class="p">(</span><span class="n">ListAPIView</span><span class="p">):</span>
<span class="n">serializer_class</span> <span class="o">=</span> <span class="n">MinimalEntitySerializer</span>

<div class="viewcode-block" id="ListEntityGeneric.get_queryset">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_views.ListEntityGeneric.get_queryset">[docs]</a>
<span class="k">def</span> <span class="nf">get_queryset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">entities</span> <span class="o">=</span> <span class="n">get_entity_classes</span><span class="p">()</span>
<span class="n">entities</span> <span class="o">=</span> <span class="p">[</span><span class="n">entity</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">model_name</span> <span class="k">for</span> <span class="n">entity</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">]</span>
<span class="n">q</span> <span class="o">=</span> <span class="n">Q</span><span class="p">()</span>
<span class="k">for</span> <span class="n">entity</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
<span class="n">q</span> <span class="o">|=</span> <span class="n">Q</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">entity</span><span class="si">}</span><span class="s2">__isnull&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">})</span>
<span class="k">return</span> <span class="n">RootObject</span><span class="o">.</span><span class="n">objects_inheritance</span><span class="o">.</span><span class="n">select_subclasses</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">q</span><span class="p">)</span></div>
</div>

</pre></div>

</div>
Expand Down
140 changes: 140 additions & 0 deletions _modules/apis_core/apis_entities/serializers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!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.apis_entities.serializers &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=9a2dae69"></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="../../../history.html">History plugin</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 active">apis_core.apis_entities.serializers</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.apis_entities.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">apis_core.generic.serializers</span> <span class="kn">import</span> <span class="n">GenericHyperlinkedIdentityField</span>


<div class="viewcode-block" id="MinimalEntitySerializer">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_views.MinimalEntitySerializer">[docs]</a>
<span class="k">class</span> <span class="nc">MinimalEntitySerializer</span><span class="p">(</span><span class="n">serializers</span><span class="o">.</span><span class="n">Serializer</span><span class="p">):</span>
<span class="n">uri</span> <span class="o">=</span> <span class="n">GenericHyperlinkedIdentityField</span><span class="p">(</span>
<span class="n">view_name</span><span class="o">=</span><span class="s2">&quot;apis_core:generic:genericmodelapi-detail&quot;</span>
<span class="p">)</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">serializers</span><span class="o">.</span><span class="n">SerializerMethodField</span><span class="p">(</span><span class="n">method_name</span><span class="o">=</span><span class="s2">&quot;get_name&quot;</span><span class="p">)</span>

<div class="viewcode-block" id="MinimalEntitySerializer.get_name">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.api_views.MinimalEntitySerializer.get_name">[docs]</a>
<span class="k">def</span> <span class="nf">get_name</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">object</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="nb">object</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>
131 changes: 131 additions & 0 deletions _modules/apis_core/apis_entities/utils.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<!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.apis_entities.utils &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=9a2dae69"></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="../../../history.html">History plugin</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 active">apis_core.apis_entities.utils</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.apis_entities.utils</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">django.apps</span> <span class="kn">import</span> <span class="n">apps</span>
<span class="kn">from</span> <span class="nn">apis_core.apis_entities.models</span> <span class="kn">import</span> <span class="n">AbstractEntity</span>


<div class="viewcode-block" id="get_entity_classes">
<a class="viewcode-back" href="../../../modules/apis_core.apis_entities.html#apis_core.apis_entities.utils.get_entity_classes">[docs]</a>
<span class="k">def</span> <span class="nf">get_entity_classes</span><span class="p">():</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="nb">issubclass</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">AbstractEntity</span><span class="p">),</span> <span class="n">apps</span><span class="o">.</span><span class="n">get_models</span><span class="p">()))</span></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>
2 changes: 2 additions & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ <h1>All modules for which code is available</h1>
<li><a href="apis_core/apis_entities/filtersets.html">apis_core.apis_entities.filtersets</a></li>
<li><a href="apis_core/apis_entities/forms.html">apis_core.apis_entities.forms</a></li>
<li><a href="apis_core/apis_entities/models.html">apis_core.apis_entities.models</a></li>
<li><a href="apis_core/apis_entities/serializers.html">apis_core.apis_entities.serializers</a></li>
<li><a href="apis_core/apis_entities/tables.html">apis_core.apis_entities.tables</a></li>
<li><a href="apis_core/apis_entities/test_api.html">apis_core.apis_entities.test_api</a></li>
<li><a href="apis_core/apis_entities/test_models.html">apis_core.apis_entities.test_models</a></li>
<li><a href="apis_core/apis_entities/urls.html">apis_core.apis_entities.urls</a></li>
<li><a href="apis_core/apis_entities/utils.html">apis_core.apis_entities.utils</a></li>
<li><a href="apis_core/apis_entities/views.html">apis_core.apis_entities.views</a></li>
<li><a href="apis_core/apis_metainfo/api_renderers.html">apis_core.apis_metainfo.api_renderers</a></li>
<li><a href="apis_core/apis_metainfo/apps.html">apis_core.apis_metainfo.apps</a></li>
Expand Down
16 changes: 16 additions & 0 deletions _sources/modules/apis_core.apis_entities.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ apis\_core.apis\_entities.models module
:undoc-members:
:show-inheritance:

apis\_core.apis\_entities.serializers module
--------------------------------------------

.. automodule:: apis_core.apis_entities.serializers
:members:
:undoc-members:
:show-inheritance:

apis\_core.apis\_entities.signals module
----------------------------------------

Expand Down Expand Up @@ -137,6 +145,14 @@ apis\_core.apis\_entities.urls module
:undoc-members:
:show-inheritance:

apis\_core.apis\_entities.utils module
--------------------------------------

.. automodule:: apis_core.apis_entities.utils
:members:
:undoc-members:
:show-inheritance:

apis\_core.apis\_entities.views module
--------------------------------------

Expand Down
Loading

0 comments on commit 4ed865e

Please sign in to comment.