Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 17, 2024
1 parent 3ad3a55 commit 725960e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
4 changes: 2 additions & 2 deletions _modules/apis_core/apis_entities/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ <h1>Source code for apis_core.apis_entities.forms</h1><div class="highlight"><pr
<span class="kn">from</span> <span class="nn">django.core.validators</span> <span class="kn">import</span> <span class="n">URLValidator</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="kn">import</span> <span class="n">reverse</span>

<span class="kn">from</span> <span class="nn">apis_core.apis_metainfo.models</span> <span class="kn">import</span> <span class="n">Uri</span><span class="p">,</span> <span class="n">Collection</span>
<span class="kn">from</span> <span class="nn">apis_core.utils</span> <span class="kn">import</span> <span class="n">DateParser</span><span class="p">,</span> <span class="n">caching</span><span class="p">,</span> <span class="n">settings</span> <span class="k">as</span> <span class="n">apis_settings</span>
<span class="kn">from</span> <span class="nn">apis_core.apis_metainfo.models</span> <span class="kn">import</span> <span class="n">Uri</span>
<span class="kn">from</span> <span class="nn">apis_core.utils</span> <span class="kn">import</span> <span class="n">caching</span><span class="p">,</span> <span class="n">settings</span> <span class="k">as</span> <span class="n">apis_settings</span>
<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>
<span class="kn">from</span> <span class="nn">.fields</span> <span class="kn">import</span> <span class="n">ListSelect2</span>

Expand Down
5 changes: 0 additions & 5 deletions _modules/apis_core/apis_entities/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,16 @@

<h1>Source code for apis_core.apis_entities.models</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">unicodedata</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">import</span> <span class="nn">reversion</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">django.contrib.auth.models</span> <span class="kn">import</span> <span class="n">Group</span>
<span class="kn">from</span> <span class="nn">django.db</span> <span class="kn">import</span> <span class="n">models</span>
<span class="kn">from</span> <span class="nn">django.db.models.signals</span> <span class="kn">import</span> <span class="n">post_save</span>
<span class="kn">from</span> <span class="nn">django.dispatch</span> <span class="kn">import</span> <span class="n">receiver</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="kn">import</span> <span class="n">reverse</span>
<span class="kn">from</span> <span class="nn">model_utils.managers</span> <span class="kn">import</span> <span class="n">InheritanceManager</span>
<span class="kn">from</span> <span class="nn">django.db.models.query</span> <span class="kn">import</span> <span class="n">QuerySet</span>

<span class="kn">from</span> <span class="nn">apis_core.utils</span> <span class="kn">import</span> <span class="n">caching</span>
<span class="kn">from</span> <span class="nn">apis_core.utils</span> <span class="kn">import</span> <span class="n">DateParser</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_relations.models</span> <span class="kn">import</span> <span class="n">TempTriple</span>
<span class="kn">from</span> <span class="nn">apis_core.apis_entities</span> <span class="kn">import</span> <span class="n">signals</span>
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_metainfo/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ <h1>Source code for apis_core.apis_metainfo.models</h1><div class="highlight"><p
<span class="bp">self</span><span class="o">.</span><span class="n">root_object</span> <span class="o">=</span> <span class="n">obj</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ImproperlyConfigured</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">uri</span><span class="si">}</span><span class="s2">: found model &lt;</span><span class="si">{</span><span class="n">model</span><span class="si">}</span><span class="s2">&gt; and attributes &lt;</span><span class="si">{</span><span class="n">attributes</span><span class="si">}</span><span class="s2">&gt;&quot;</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">uri</span><span class="si">}</span><span class="s2">: found model &lt;</span><span class="si">{</span><span class="n">model</span><span class="si">}</span><span class="s2">&gt; and attributes &lt;</span><span class="si">{</span><span class="n">attributes</span><span class="si">}</span><span class="s2">&gt;&quot;</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ValidationError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">e</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">uri</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span></div>
Expand Down
16 changes: 1 addition & 15 deletions _modules/apis_core/apis_relations/rel_filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@
<div itemprop="articleBody">

<h1>Source code for apis_core.apis_relations.rel_filters</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">operator</span>
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">reduce</span>

<span class="kn">import</span> <span class="nn">django_filters</span>
<span></span><span class="kn">import</span> <span class="nn">django_filters</span>
<span class="kn">from</span> <span class="nn">dal</span> <span class="kn">import</span> <span class="n">autocomplete</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">django.contrib.contenttypes.models</span> <span class="kn">import</span> <span class="n">ContentType</span>
Expand Down Expand Up @@ -194,8 +191,6 @@ <h1>Source code for apis_core.apis_relations.rel_filters</h1><div class="highlig
<a class="viewcode-back" href="../../../modules/apis_core.apis_relations.html#apis_core.apis_relations.rel_filters.get_generic_relation_filter">[docs]</a>
<span class="k">def</span> <span class="nf">get_generic_relation_filter</span><span class="p">(</span><span class="n">entity</span><span class="p">):</span>
<span class="k">class</span> <span class="nc">GenericListFilter</span><span class="p">(</span><span class="n">django_filters</span><span class="o">.</span><span class="n">FilterSet</span><span class="p">):</span>
<span class="c1"># search = django_filters.CharFilter(method=&#39;search_filter_method&#39;)</span>

<span class="k">def</span> <span class="nf">name_label_filter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">queryset</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Filter for including the alternative names in the names search.\</span>
Expand Down Expand Up @@ -257,15 +252,6 @@ <h1>Source code for apis_core.apis_relations.rel_filters</h1><div class="highlig
<span class="n">f</span> <span class="o">+=</span> <span class="s2">&quot;exact&quot;</span>
<span class="k">return</span> <span class="n">queryset</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="n">f</span><span class="p">:</span> <span class="n">value</span><span class="p">})</span>

<span class="k">def</span> <span class="nf">search_filter_method</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">queryset</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="bp">cls</span> <span class="o">=</span> <span class="n">queryset</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="vm">__name__</span>
<span class="n">sett_filters</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="s2">&quot;APIS_RELATIONS&quot;</span><span class="p">,</span> <span class="p">{})</span>
<span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="n">sett_filters</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">filter_attr</span> <span class="o">=</span> <span class="n">sett_filters</span><span class="p">[</span><span class="bp">cls</span><span class="o">.</span><span class="n">lower</span><span class="p">()]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;search&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">])</span>
<span class="n">query</span> <span class="o">=</span> <span class="n">reduce</span><span class="p">(</span>
<span class="n">operator</span><span class="o">.</span><span class="n">or_</span><span class="p">,</span> <span class="p">[</span><span class="n">Q</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="n">attr</span><span class="p">:</span> <span class="n">value</span><span class="p">})</span> <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">filter_attr</span><span class="p">]</span>
<span class="p">)</span>

<span class="k">class</span> <span class="nc">Meta</span><span class="p">:</span>
<span class="c1"># model = AbstractRelation.get_relation_class_of_name(entity)</span>
<span class="n">model</span> <span class="o">=</span> <span class="kc">None</span>
Expand Down
1 change: 0 additions & 1 deletion _modules/apis_core/utils/helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ <h1>Source code for apis_core.utils.helpers</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">inspect</span>
<span class="kn">import</span> <span class="nn">itertools</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Type</span>


<span class="kn">from</span> <span class="nn">apis_core.apis_relations.models</span> <span class="kn">import</span> <span class="n">Property</span><span class="p">,</span> <span class="n">TempTriple</span>
Expand Down

0 comments on commit 725960e

Please sign in to comment.