evennia/docs/0.x/api/evennia.help.models.html
2023-12-20 19:10:09 +01:00

412 lines
No EOL
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.help.models &#8212; Evennia 0.9.5 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.help.models</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.help.models">
<span id="evennia-help-models"></span><h1>evennia.help.models<a class="headerlink" href="#module-evennia.help.models" title="Permalink to this headline"></a></h1>
<p>Models for the help system.</p>
<p>The database-tied help system is only half of Evennias help
functionality, the other one being the auto-generated command help
that is created on the fly from each commands <strong>__doc__</strong> string. The
persistent database system defined here is intended for all other
forms of help that do not concern commands, like information about the
game world, policy info, rules and similar.</p>
<dl class="py class">
<dt id="evennia.help.models.HelpEntry">
<em class="property">class </em><code class="sig-prename descclassname">evennia.help.models.</code><code class="sig-name descname">HelpEntry</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.utils.idmapper.models.html#evennia.utils.idmapper.models.SharedMemoryModel" title="evennia.utils.idmapper.models.SharedMemoryModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.utils.idmapper.models.SharedMemoryModel</span></code></a></p>
<p>A generic help entry.</p>
<dl class="simple">
<dt>An HelpEntry object has the following properties defined:</dt><dd><p>key - main name of entry
help_category - which category entry belongs to (defaults to General)
entrytext - the actual help text
permissions - perm strings</p>
</dd>
<dt>Method:</dt><dd><p>access</p>
</dd>
</dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_key">
<code class="sig-name descname">db_key</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_key" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_help_category">
<code class="sig-name descname">db_help_category</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_help_category" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_entrytext">
<code class="sig-name descname">db_entrytext</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_entrytext" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_lock_storage">
<code class="sig-name descname">db_lock_storage</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_lock_storage" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_tags">
<code class="sig-name descname">db_tags</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_tags" title="Permalink to this definition"></a></dt>
<dd><p>Accessor to the related objects manager on the forward and reverse sides of
a many-to-many relation.</p>
<p>In the example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Pizza</span><span class="p">(</span><span class="n">Model</span><span class="p">):</span>
<span class="n">toppings</span> <span class="o">=</span> <span class="n">ManyToManyField</span><span class="p">(</span><span class="n">Topping</span><span class="p">,</span> <span class="n">related_name</span><span class="o">=</span><span class="s1">&#39;pizzas&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>**Pizza.toppings**</strong> and <strong>**Topping.pizzas**</strong> are <strong>**ManyToManyDescriptor**</strong>
instances.</p>
<p>Most of the implementation is delegated to a dynamically defined manager
class built by <strong>**create_forward_many_to_many_manager()**</strong> defined below.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.db_staff_only">
<code class="sig-name descname">db_staff_only</code><a class="headerlink" href="#evennia.help.models.HelpEntry.db_staff_only" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.objects">
<code class="sig-name descname">objects</code><em class="property"> = &lt;evennia.help.manager.HelpEntryManager object&gt;</em><a class="headerlink" href="#evennia.help.models.HelpEntry.objects" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.locks">
<code class="sig-name descname">locks</code><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.locks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.locks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.tags">
<code class="sig-name descname">tags</code><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.tags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.tags" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.aliases">
<code class="sig-name descname">aliases</code><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.aliases"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.access">
<code class="sig-name descname">access</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">accessing_obj</span></em>, <em class="sig-param"><span class="n">access_type</span><span class="o">=</span><span class="default_value">'read'</span></em>, <em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.access"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.access" title="Permalink to this definition"></a></dt>
<dd><p>Determines if another object has permission to access.
accessing_obj - object trying to access this one
access_type - type of access sought
default - what to return if no lock of access_type was found</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_admin_url">
<code class="sig-name descname">web_get_admin_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_admin_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_admin_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for the Django Admin page for this object.</p>
<p>ex. Account#1 = /admin/accounts/accountdb/1/change/</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to Django Admin page for object.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_create_url">
<em class="property">classmethod </em><code class="sig-name descname">web_get_create_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_create_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_create_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for a View that allows users to create new
instances of this object.</p>
<p>ex. Chargen = /characters/create/</p>
<p>For this to work, the developer must have defined a named view somewhere
in urls.py that follows the format modelname-action, so in this case
a named view of character-create would be referenced by this method.</p>
<p>ex.
url(rcharacters/create/, ChargenView.as_view(), name=character-create)</p>
<p>If no View has been created and defined in urls.py, returns an
HTML anchor.</p>
<p>This method is naive and simply returns a path. Securing access to
the actual view and limiting who can create new objects is the
developers responsibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to object creation page, if defined.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_detail_url">
<code class="sig-name descname">web_get_detail_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_detail_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_detail_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for a View that allows users to view details for
this object.</p>
<p>ex. Oscar (Character) = /characters/oscar/1/</p>
<p>For this to work, the developer must have defined a named view somewhere
in urls.py that follows the format modelname-action, so in this case
a named view of character-detail would be referenced by this method.</p>
<p>ex.
url(rcharacters/(?P&lt;slug&gt;[wd-]+)/(?P&lt;pk&gt;[0-9]+)/$,</p>
<blockquote>
<div><p>CharDetailView.as_view(), name=character-detail)</p>
</div></blockquote>
<p>If no View has been created and defined in urls.py, returns an
HTML anchor.</p>
<p>This method is naive and simply returns a path. Securing access to
the actual view and limiting who can view this object is the developers
responsibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to object detail page, if defined.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_update_url">
<code class="sig-name descname">web_get_update_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_update_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_update_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for a View that allows users to update this
object.</p>
<p>ex. Oscar (Character) = /characters/oscar/1/change/</p>
<p>For this to work, the developer must have defined a named view somewhere
in urls.py that follows the format modelname-action, so in this case
a named view of character-update would be referenced by this method.</p>
<p>ex.
url(rcharacters/(?P&lt;slug&gt;[wd-]+)/(?P&lt;pk&gt;[0-9]+)/change/$,</p>
<blockquote>
<div><p>CharUpdateView.as_view(), name=character-update)</p>
</div></blockquote>
<p>If no View has been created and defined in urls.py, returns an
HTML anchor.</p>
<p>This method is naive and simply returns a path. Securing access to
the actual view and limiting who can modify objects is the developers
responsibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to object update page, if defined.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_delete_url">
<code class="sig-name descname">web_get_delete_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_delete_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_delete_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for a View that allows users to delete this object.</p>
<p>ex. Oscar (Character) = /characters/oscar/1/delete/</p>
<p>For this to work, the developer must have defined a named view somewhere
in urls.py that follows the format modelname-action, so in this case
a named view of character-detail would be referenced by this method.</p>
<p>ex.
url(rcharacters/(?P&lt;slug&gt;[wd-]+)/(?P&lt;pk&gt;[0-9]+)/delete/$,</p>
<blockquote>
<div><p>CharDeleteView.as_view(), name=character-delete)</p>
</div></blockquote>
<p>If no View has been created and defined in urls.py, returns an
HTML anchor.</p>
<p>This method is naive and simply returns a path. Securing access to
the actual view and limiting who can delete this object is the developers
responsibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to object deletion page, if defined.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.get_absolute_url">
<code class="sig-name descname">get_absolute_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#evennia.help.models.HelpEntry.get_absolute_url" title="Permalink to this definition"></a></dt>
<dd><p>Returns the URI path for a View that allows users to view details for
this object.</p>
<p>ex. Oscar (Character) = /characters/oscar/1/</p>
<p>For this to work, the developer must have defined a named view somewhere
in urls.py that follows the format modelname-action, so in this case
a named view of character-detail would be referenced by this method.</p>
<p>ex.
url(rcharacters/(?P&lt;slug&gt;[wd-]+)/(?P&lt;pk&gt;[0-9]+)/$,</p>
<blockquote>
<div><p>CharDetailView.as_view(), name=character-detail)</p>
</div></blockquote>
<p>If no View has been created and defined in urls.py, returns an
HTML anchor.</p>
<p>This method is naive and simply returns a path. Securing access to
the actual view and limiting who can view this object is the developers
responsibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>path (str)</em> URI path to object detail page, if defined.</p>
</dd>
</dl>
</dd></dl>
<dl class="py exception">
<dt id="evennia.help.models.HelpEntry.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.help.models.HelpEntry.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">django.core.exceptions.ObjectDoesNotExist</span></code></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.help.models.HelpEntry.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.help.models.HelpEntry.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">django.core.exceptions.MultipleObjectsReturned</span></code></p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.entrytext">
<em class="property">property </em><code class="sig-name descname">entrytext</code><a class="headerlink" href="#evennia.help.models.HelpEntry.entrytext" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for getting database field <strong>db_entrytext</strong>.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.help_category">
<em class="property">property </em><code class="sig-name descname">help_category</code><a class="headerlink" href="#evennia.help.models.HelpEntry.help_category" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for getting database field <strong>db_help_category</strong>.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.id">
<code class="sig-name descname">id</code><a class="headerlink" href="#evennia.help.models.HelpEntry.id" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.key">
<em class="property">property </em><code class="sig-name descname">key</code><a class="headerlink" href="#evennia.help.models.HelpEntry.key" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for getting database field <strong>db_key</strong>.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.lock_storage">
<em class="property">property </em><code class="sig-name descname">lock_storage</code><a class="headerlink" href="#evennia.help.models.HelpEntry.lock_storage" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for getting database field <strong>db_lock_storage</strong>.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.help.models.HelpEntry'</em><a class="headerlink" href="#evennia.help.models.HelpEntry.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.staff_only">
<em class="property">property </em><code class="sig-name descname">staff_only</code><a class="headerlink" href="#evennia.help.models.HelpEntry.staff_only" title="Permalink to this definition"></a></dt>
<dd><p>A wrapper for getting database field <strong>db_staff_only</strong>.</p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.help.models.HelpEntry.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'SharedMemoryModelBase'</em><a class="headerlink" href="#evennia.help.models.HelpEntry.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.help.models.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li><a href="http://webchat.freenode.net/?channels=evennia&uio=MT1mYWxzZSY5PXRydWUmMTE9MTk1JjEyPXRydWUbb">IRC</a> -
<a href="https://discord.gg/NecFePw">Discord</a> -
<a href="https://groups.google.com/forum/#%21forum/evennia">Forums</a>
</li>
<li><a href="http://evennia.blogspot.com/">Evennia Dev blog</a> </li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="../../1.0-dev/api/evennia.help.models.html">1.0-dev (develop branch)</a></li>
<li><a href="evennia.help.models.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.help.models</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>