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 19, 2024
1 parent 1e3be66 commit d204830
Show file tree
Hide file tree
Showing 189 changed files with 724 additions and 720 deletions.
1 change: 1 addition & 0 deletions _modules/apis_core/apis_entities/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h1>Source code for apis_core.apis_entities.forms</h1><div class="highlight"><pr
<span class="s2">&quot;data-placeholder&quot;</span><span class="p">:</span> <span class="s2">&quot;Search ...&quot;</span><span class="p">,</span>
<span class="s2">&quot;data-minimum-input-length&quot;</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="s2">&quot;data-html&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;data-tags&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="p">}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;uri&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span> <span class="o">=</span> <span class="n">autocomplete</span><span class="o">.</span><span class="n">ModelSelect2</span><span class="p">(</span><span class="n">uri</span><span class="p">,</span> <span class="n">attrs</span><span class="o">=</span><span class="n">attrs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;uri&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span><span class="o">.</span><span class="n">choices</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;uri&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">choices</span>
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/apis_relations/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ <h1>Source code for apis_core.apis_relations.forms</h1><div class="highlight"><p
<span class="n">ct</span> <span class="o">=</span> <span class="nb">next</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="n">x</span><span class="o">.</span><span class="n">model</span> <span class="o">==</span> <span class="n">entity_type_other_str</span><span class="o">.</span><span class="n">lower</span><span class="p">(),</span> <span class="n">contenttypes</span><span class="p">)</span>
<span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;apis_core:generic:autocomplete&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="n">ct</span><span class="p">])</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;apis_core:generic:autocomplete&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="n">ct</span><span class="p">])</span> <span class="o">+</span> <span class="s2">&quot;?create=True&quot;</span>

<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;other_entity&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">autocomplete</span><span class="o">.</span><span class="n">Select2ListCreateChoiceField</span><span class="p">(</span>
<span class="n">label</span><span class="o">=</span><span class="s2">&quot;entity&quot;</span><span class="p">,</span>
Expand Down
2 changes: 1 addition & 1 deletion _modules/apis_core/generic/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h1>Source code for apis_core.generic.forms</h1><div class="highlight"><pre>
<span class="n">ct</span> <span class="o">=</span> <span class="n">ContentType</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get_for_model</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">Meta</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;apis_core:generic:autocompleteexternalonly&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="n">ct</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;url&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span> <span class="o">=</span> <span class="n">autocomplete</span><span class="o">.</span><span class="n">ModelSelect2</span><span class="p">(</span>
<span class="n">url</span><span class="p">,</span> <span class="n">attrs</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;data-html&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span>
<span class="n">url</span><span class="p">,</span> <span class="n">attrs</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;data-html&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">&quot;data-tags&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;url&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span><span class="o">.</span><span class="n">choices</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;url&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">choices</span>
<span class="bp">self</span><span class="o">.</span><span class="n">helper</span> <span class="o">=</span> <span class="n">FormHelper</span><span class="p">()</span>
Expand Down
5 changes: 4 additions & 1 deletion _modules/apis_core/generic/views.html
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,15 @@ <h1>Source code for apis_core.generic.views</h1><div class="highlight"><pre>

<span class="n">permission_action_required</span> <span class="o">=</span> <span class="s2">&quot;view&quot;</span>
<span class="n">template_name_suffix</span> <span class="o">=</span> <span class="s2">&quot;_autocomplete_result&quot;</span>
<span class="n">create_field</span> <span class="o">=</span> <span class="s2">&quot;thisisnotimportant&quot;</span> <span class="c1"># because we are using create_object_from_uri</span>

<div class="viewcode-block" id="Autocomplete.setup">
<a class="viewcode-back" href="../../../modules/apis_core.generic.html#apis_core.generic.views.Autocomplete.setup">[docs]</a>
<span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="bp">self</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="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setup</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="c1"># We use a URI parameter to enable the create functionality in the</span>
<span class="c1"># autocomplete dropdown. It is not important what the value of the</span>
<span class="c1"># `create_field` is, because we use create_object_from_uri anyway.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">create_field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">request</span><span class="o">.</span><span class="n">GET</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;create&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">template</span> <span class="o">=</span> <span class="n">select_template</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_template_names</span><span class="p">())</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template</span> <span class="o">=</span> <span class="n">template</span><span class="o">.</span><span class="n">template</span><span class="o">.</span><span class="n">name</span>
Expand Down
2 changes: 2 additions & 0 deletions _modules/apis_core/relations/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ <h1>Source code for apis_core.relations.forms</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;subj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span> <span class="o">=</span> <span class="n">autocomplete</span><span class="o">.</span><span class="n">ListSelect2</span><span class="p">(</span>
<span class="n">url</span><span class="o">=</span><span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;apis_core:generic:autocomplete&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="n">ct</span><span class="p">])</span>
<span class="o">+</span> <span class="s2">&quot;?create=True&quot;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;subj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span><span class="o">.</span><span class="n">choices</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;subj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">choices</span>
<span class="k">else</span><span class="p">:</span>
Expand Down Expand Up @@ -244,6 +245,7 @@ <h1>Source code for apis_core.relations.forms</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;obj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span> <span class="o">=</span> <span class="n">autocomplete</span><span class="o">.</span><span class="n">ListSelect2</span><span class="p">(</span>
<span class="n">url</span><span class="o">=</span><span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;apis_core:generic:autocomplete&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="n">ct</span><span class="p">])</span>
<span class="o">+</span> <span class="s2">&quot;?create=True&quot;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;obj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">widget</span><span class="o">.</span><span class="n">choices</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fields</span><span class="p">[</span><span class="s2">&quot;obj&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">choices</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
6 changes: 2 additions & 4 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1297,10 +1297,10 @@ <h2 id="C">C</h2>
<li><a href="modules/apis_core.generic.forms.html#apis_core.generic.forms.GenericFilterSetForm.columns_exclude">(apis_core.generic.forms.GenericFilterSetForm attribute)</a>
</li>
</ul></li>
<li><a href="modules/apis_core.history.html#apis_core.history.models.APISHistoryTableBase.Meta.constraints">constraints (apis_core.history.models.APISHistoryTableBase.Meta attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/apis_core.history.html#apis_core.history.models.APISHistoryTableBase.Meta.constraints">constraints (apis_core.history.models.APISHistoryTableBase.Meta attribute)</a>
</li>
<li><a href="modules/apis_core.utils.html#apis_core.utils.helpers.construct_lookup">construct_lookup() (in module apis_core.utils.helpers)</a>
</li>
<li><a href="modules/apis_core.collections.html#apis_core.collections.models.SkosCollectionContentObject.content_object">content_object (apis_core.collections.models.SkosCollectionContentObject attribute)</a>
Expand All @@ -1326,8 +1326,6 @@ <h2 id="C">C</h2>
<li><a href="modules/apis_core.generic.html#apis_core.generic.views.Create">Create (class in apis_core.generic.views)</a>
</li>
<li><a href="modules/apis_core.apis_entities.html#apis_core.apis_entities.models.create_default_uri">create_default_uri() (in module apis_core.apis_entities.models)</a>
</li>
<li><a href="modules/apis_core.generic.html#apis_core.generic.views.Autocomplete.create_field">create_field (apis_core.generic.views.Autocomplete attribute)</a>
</li>
<li><a href="modules/apis_core.generic.html#apis_core.generic.importers.GenericModelImporter.create_instance">create_instance() (apis_core.generic.importers.GenericModelImporter method)</a>
</li>
Expand Down
30 changes: 15 additions & 15 deletions htmlcov/class_index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d204830

Please sign in to comment.