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 1242e67 commit cd00263
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
23 changes: 22 additions & 1 deletion _modules/apis_core/generic/serializers.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@
<div itemprop="articleBody">

<h1>Source code for apis_core.generic.serializers</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">django.contrib.contenttypes.models</span> <span class="kn">import</span> <span class="n">ContentType</span>
<span></span><span class="kn">from</span> <span class="nn">django.shortcuts</span> <span class="kn">import</span> <span class="n">get_object_or_404</span>
<span class="kn">from</span> <span class="nn">django.contrib.contenttypes.models</span> <span class="kn">import</span> <span class="n">ContentType</span>
<span class="kn">from</span> <span class="nn">rest_framework.serializers</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">HyperlinkedModelSerializer</span><span class="p">,</span>
<span class="n">HyperlinkedRelatedField</span><span class="p">,</span>
<span class="n">Serializer</span><span class="p">,</span>
<span class="n">CharField</span><span class="p">,</span>
<span class="n">IntegerField</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">rest_framework.reverse</span> <span class="kn">import</span> <span class="n">reverse</span>

Expand Down Expand Up @@ -157,6 +161,23 @@ <h1>Source code for apis_core.generic.serializers</h1><div class="highlight"><pr
<span class="p">)</span>
<span class="k">return</span> <span class="n">serializer</span></div>



<div class="viewcode-block" id="ContentTypeInstanceSerializer">
<a class="viewcode-back" href="../../../modules/apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer">[docs]</a>
<span class="k">class</span> <span class="nc">ContentTypeInstanceSerializer</span><span class="p">(</span><span class="n">Serializer</span><span class="p">):</span>
<span class="nb">id</span> <span class="o">=</span> <span class="n">IntegerField</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">content_type</span> <span class="o">=</span> <span class="n">CharField</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<div class="viewcode-block" id="ContentTypeInstanceSerializer.to_internal_value">
<a class="viewcode-back" href="../../../modules/apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer.to_internal_value">[docs]</a>
<span class="k">def</span> <span class="nf">to_internal_value</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">data</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">to_internal_value</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">app_label</span><span class="p">,</span> <span class="n">model</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;content_type&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;.&quot;</span><span class="p">)</span>
<span class="n">content_type</span> <span class="o">=</span> <span class="n">get_object_or_404</span><span class="p">(</span><span class="n">ContentType</span><span class="p">,</span> <span class="n">app_label</span><span class="o">=</span><span class="n">app_label</span><span class="p">,</span> <span class="n">model</span><span class="o">=</span><span class="n">model</span><span class="p">)</span>
<span class="k">return</span> <span class="n">get_object_or_404</span><span class="p">(</span><span class="n">content_type</span><span class="o">.</span><span class="n">model_class</span><span class="p">(),</span> <span class="n">pk</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">))</span></div>
</div>

</pre></div>

</div>
Expand Down
8 changes: 6 additions & 2 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,10 @@ <h2 id="C">C</h2>
<li><a href="modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.serializers.CollectionSerializer">(class in apis_core.apis_metainfo.serializers)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.serializers.CollectionSerializer.Meta">CollectionSerializer.Meta (class in apis_core.apis_metainfo.serializers)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/apis_core.collections.html#apis_core.collections.views.CollectionToggle">CollectionToggle (class in apis_core.collections.views)</a>
</li>
<li><a href="modules/apis_core.apis_entities.html#apis_core.apis_entities.filtersets.AbstractEntityFilterSetForm.columns_exclude">columns_exclude (apis_core.apis_entities.filtersets.AbstractEntityFilterSetForm attribute)</a>
Expand All @@ -963,6 +963,8 @@ <h2 id="C">C</h2>
<li><a href="modules/apis_core.collections.html#apis_core.collections.views.ContentObjectMixin">ContentObjectMixin (class in apis_core.collections.views)</a>
</li>
<li><a href="modules/apis_core.generic.html#apis_core.generic.urls.ContenttypeConverter">ContenttypeConverter (class in apis_core.generic.urls)</a>
</li>
<li><a href="modules/apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer">ContentTypeInstanceSerializer (class in apis_core.generic.serializers)</a>
</li>
<li><a href="modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.serializers.ContentTypeSerializer">ContentTypeSerializer (class in apis_core.apis_metainfo.serializers)</a>
</li>
Expand Down Expand Up @@ -2504,6 +2506,8 @@ <h2 id="T">T</h2>
<li><a href="modules/apis_core.apis_metainfo.html#apis_core.apis_metainfo.test_models.ModelTestCase.test_uri">test_uri() (apis_core.apis_metainfo.test_models.ModelTestCase method)</a>
</li>
<li><a href="modules/apis_core.apis_entities.html#apis_core.apis_entities.serializers_generic.TextSerializer">TextSerializer (class in apis_core.apis_entities.serializers_generic)</a>
</li>
<li><a href="modules/apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer.to_internal_value">to_internal_value() (apis_core.generic.serializers.ContentTypeInstanceSerializer method)</a>
</li>
<li><a href="modules/apis_core.apis_entities.html#apis_core.apis_entities.urls.EntityToContenttypeConverter.to_python">to_python() (apis_core.apis_entities.urls.EntityToContenttypeConverter method)</a>

Expand Down
14 changes: 14 additions & 0 deletions modules/apis_core.generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,20 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
</section>
<section id="module-apis_core.generic.serializers">
<span id="apis-core-generic-serializers-module"></span><h2>apis_core.generic.serializers module<a class="headerlink" href="#module-apis_core.generic.serializers" title="Link to this heading"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="apis_core.generic.serializers.ContentTypeInstanceSerializer">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apis_core.generic.serializers.</span></span><span class="sig-name descname"><span class="pre">ContentTypeInstanceSerializer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apis_core/generic/serializers.html#ContentTypeInstanceSerializer"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apis_core.generic.serializers.ContentTypeInstanceSerializer" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Serializer</span></code></p>
<p>When a field is instantiated, we store the arguments that were used,
so that we can present a helpful representation of the object.</p>
<dl class="py method">
<dt class="sig sig-object py" id="apis_core.generic.serializers.ContentTypeInstanceSerializer.to_internal_value">
<span class="sig-name descname"><span class="pre">to_internal_value</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apis_core/generic/serializers.html#ContentTypeInstanceSerializer.to_internal_value"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apis_core.generic.serializers.ContentTypeInstanceSerializer.to_internal_value" title="Link to this definition"></a></dt>
<dd><p>Dict of native values &lt;- Dict of primitive datatypes.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="apis_core.generic.serializers.GenericHyperlinkedIdentityField">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">apis_core.generic.serializers.</span></span><span class="sig-name descname"><span class="pre">GenericHyperlinkedIdentityField</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apis_core/generic/serializers.html#GenericHyperlinkedIdentityField"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#apis_core.generic.serializers.GenericHyperlinkedIdentityField" title="Link to this definition"></a></dt>
Expand Down
4 changes: 4 additions & 0 deletions modules/apis_core.html
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="apis_core.generic.html#module-apis_core.generic.serializers">apis_core.generic.serializers module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer"><code class="docutils literal notranslate"><span class="pre">ContentTypeInstanceSerializer</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="apis_core.generic.html#apis_core.generic.serializers.ContentTypeInstanceSerializer.to_internal_value"><code class="docutils literal notranslate"><span class="pre">ContentTypeInstanceSerializer.to_internal_value()</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="apis_core.generic.html#apis_core.generic.serializers.GenericHyperlinkedIdentityField"><code class="docutils literal notranslate"><span class="pre">GenericHyperlinkedIdentityField</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="apis_core.generic.html#apis_core.generic.serializers.GenericHyperlinkedModelSerializer"><code class="docutils literal notranslate"><span class="pre">GenericHyperlinkedModelSerializer</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="apis_core.generic.html#apis_core.generic.serializers.GenericHyperlinkedModelSerializer.serializer_related_field"><code class="docutils literal notranslate"><span class="pre">GenericHyperlinkedModelSerializer.serializer_related_field</span></code></a></li>
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 cd00263

Please sign in to comment.