mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 07:46:30 +01:00
1796 lines
No EOL
170 KiB
HTML
1796 lines
No EOL
170 KiB
HTML
<!DOCTYPE html>
|
||
|
||
<html lang="en" data-content_root="../">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<title>evennia.typeclasses.attributes — Evennia latest documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=d75fae25" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/nature.css?v=279e0f84" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=e4a91a55" />
|
||
<script src="../_static/documentation_options.js?v=c6e86fd7"></script>
|
||
<script src="../_static/doctools.js?v=9bcbadda"></script>
|
||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<link rel="icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="evennia.typeclasses.managers" href="evennia.typeclasses.managers.html" />
|
||
<link rel="prev" title="evennia.typeclasses" href="evennia.typeclasses.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="Related">
|
||
<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="right" >
|
||
<a href="evennia.typeclasses.managers.html" title="evennia.typeclasses.managers"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.typeclasses.html" title="evennia.typeclasses"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-4"><a href="evennia.typeclasses.html" accesskey="U">evennia.typeclasses</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.typeclasses.attributes</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section id="module-evennia.typeclasses.attributes">
|
||
<span id="evennia-typeclasses-attributes"></span><h1>evennia.typeclasses.attributes<a class="headerlink" href="#module-evennia.typeclasses.attributes" title="Link to this heading">¶</a></h1>
|
||
<p>Attributes are arbitrary data stored on objects. Attributes supports
|
||
both pure-string values and pickled arbitrary data.</p>
|
||
<p>Attributes are also used to implement Nicks. This module also contains
|
||
the Attribute- and NickHandlers as well as the <strong>NAttributeHandler</strong>,
|
||
which is a non-db version of Attributes.</p>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">IAttribute</span></span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>Attributes are things that are specific to different types of objects. For
|
||
example, a drink container needs to store its fill level, whereas an exit
|
||
needs to store its open/closed/locked/unlocked state. These are done via
|
||
attributes, rather than making different classes for each object type and
|
||
storing them directly. The added benefit is that we can add/remove
|
||
attributes on the fly as we like.</p>
|
||
<dl class="simple">
|
||
<dt>The Attribute class defines the following properties:</dt><dd><ul class="simple">
|
||
<li><p>key (str): Primary identifier.</p></li>
|
||
<li><p>lock_storage (str): Perm strings.</p></li>
|
||
<li><dl class="simple">
|
||
<dt>model (str): A string defining the model this is connected to. This</dt><dd><p>is a natural_key, like “objects.objectdb”</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
<li><p>date_created (datetime): When the attribute was created.</p></li>
|
||
<li><dl class="simple">
|
||
<dt>value (any): The data stored in the attribute, in pickled form</dt><dd><p>using wrappers to be able to store/retrieve models.</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
<li><dl class="simple">
|
||
<dt>strvalue (str): String-only data. This data is not pickled and</dt><dd><p>is thus faster to search for in the database.</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
<li><dl class="simple">
|
||
<dt>category (str): Optional character string for grouping the</dt><dd><p>Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>This class is an API/Interface/Abstract base class; do not instantiate it directly.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.locks">
|
||
<span class="sig-name descname"><span class="pre">locks</span></span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttribute.locks"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.locks" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.key">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">key</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.key" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.strvalue">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">strvalue</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.strvalue" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.category">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">category</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.category" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.model">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">model</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.model" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.attrtype">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">attrtype</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.attrtype" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.date_created">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">date_created</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.date_created" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.lock_storage">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">lock_storage</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.lock_storage" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttribute.access">
|
||
<span class="sig-name descname"><span class="pre">access</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">access_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'read'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</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/evennia/typeclasses/attributes.html#IAttribute.access"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttribute.access" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Determines if another object has permission to access.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em>) – Entity trying to access this one.</p></li>
|
||
<li><p><strong>access_type</strong> (<em>str</em><em>, </em><em>optional</em>) – Type of access sought, see
|
||
the lock documentation.</p></li>
|
||
<li><p><strong>default</strong> (<em>bool</em><em>, </em><em>optional</em>) – What result to return if no lock
|
||
of access_type was found. The default, <strong>False</strong>, means a lockdown
|
||
policy, only allowing explicit access.</p></li>
|
||
<li><p><strong>kwargs</strong> (<em>any</em><em>, </em><em>optional</em>) – Not used; here to make the API consistent with
|
||
other access calls.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>result (bool)</em> – If the lock was passed or not.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttribute">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">InMemoryAttribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pk</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/evennia/typeclasses/attributes.html#InMemoryAttribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><code class="xref py py-class docutils literal notranslate"><span class="pre">IAttribute</span></code></a></p>
|
||
<p>This Attribute is used purely for NAttributes/NAttributeHandler. It has no database backend.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttribute.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pk</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/evennia/typeclasses/attributes.html#InMemoryAttribute.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttribute.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Create an Attribute that exists only in Memory.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>pk</strong> (<em>int</em>) – This is a fake ‘primary key’ / id-field. It doesn’t actually have to be
|
||
unique, but is fed an incrementing number from the InMemoryBackend by default. This
|
||
is needed only so Attributes can be sorted. Some parts of the API also see the lack
|
||
of a .pk field as a sign that the Attribute was deleted.</p></li>
|
||
<li><p><strong>**kwargs</strong> – Other keyword arguments are used to construct the actual Attribute.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttribute.value">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">value</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttribute.value" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">AttributeProperty</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">autocreate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeProperty"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>AttributeProperty.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty.attrhandler_name">
|
||
<span class="sig-name descname"><span class="pre">attrhandler_name</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'attributes'</span></em><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty.attrhandler_name" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty.cached_default_name_template">
|
||
<span class="sig-name descname"><span class="pre">cached_default_name_template</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'_property_attribute_default_{key}'</span></em><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty.cached_default_name_template" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">autocreate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeProperty.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while
|
||
one can set a lock on the Attribute, there is no way to <em>check</em> said lock when accessing via
|
||
the property - use the full <strong>AttributeHandler</strong> if you need to do access checks. Note however
|
||
that if you use the full <strong>AttributeHandler</strong> to access this Attribute, the <strong>at_get/at_set</strong>
|
||
methods on this class will _not_ fire (because you are bypassing the <strong>AttributeProperty</strong>
|
||
entirely in that case).</p>
|
||
<p>Initialize an Attribute as a property descriptor.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Keyword Arguments<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>default</strong> (<em>any</em>) – A default value if the attr is not set. If a callable, this will be
|
||
run without any arguments and is expected to return the default value.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em>) – The attribute’s category. If unset, use class default.</p></li>
|
||
<li><p><strong>strattr</strong> (<em>bool</em>) – If set, this Attribute <em>must</em> be a simple string, and will be
|
||
stored more efficiently.</p></li>
|
||
<li><p><strong>lockstring</strong> (<em>str</em>) – This is not itself useful with the property, but only if
|
||
using the full AttributeHandler.get(accessing_obj=…) to access the
|
||
Attribute.</p></li>
|
||
<li><p><strong>autocreate</strong> (<em>bool</em>) – True by default; this means Evennia makes sure to create a new
|
||
copy of the Attribute (with the default value) whenever a new object with this
|
||
property is created. If <strong>False</strong>, no Attribute will be created until the property
|
||
is explicitly assigned a value. This makes it more efficient while it retains
|
||
its default (there’s no db access), but without an actual Attribute generated,
|
||
one cannot access it via .db, the AttributeHandler or see it with <strong>examine</strong>.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>Example:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">class</span><span class="w"> </span><span class="nc">Character</span><span class="p">(</span><span class="n">DefaultCharacter</span><span class="p">):</span>
|
||
<span class="n">foo</span> <span class="o">=</span> <span class="n">AttributeProperty</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="s2">"Bar"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty.at_set">
|
||
<span class="sig-name descname"><span class="pre">at_set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">obj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeProperty.at_set"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty.at_set" title="Link to this definition">¶</a></dt>
|
||
<dd><p>The value to set is passed through the method. It can be used to customize/validate
|
||
the input in a custom child class.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>value</strong> (<em>any</em>) – The value about to the stored in this Attribute.</p></li>
|
||
<li><p><strong>obj</strong> (<em>object</em>) – Object the attribute is attached to</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>any</em> – The value to store.</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>AttributeError</strong> – If the value is invalid to store.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This is will only fire if you actually set the Attribute via this <strong>AttributeProperty</strong>.
|
||
That is, if you instead set it via the <strong>AttributeHandler</strong> (or via <strong>.db</strong>), you are
|
||
bypassing this <strong>AttributeProperty</strong> entirely and this method is never reached.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeProperty.at_get">
|
||
<span class="sig-name descname"><span class="pre">at_get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">obj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeProperty.at_get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeProperty.at_get" title="Link to this definition">¶</a></dt>
|
||
<dd><p>The value returned from the Attribute is passed through this method. It can be used
|
||
to react to the retrieval or modify the result in some way.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>value</strong> (<em>any</em>) – Value returned from the Attribute.</p></li>
|
||
<li><p><strong>obj</strong> (<em>object</em>) – Object the attribute is attached to</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>any</em> – The value to return to the caller.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This is will only fire if you actually get the Attribute via this <strong>AttributeProperty</strong>.
|
||
That is, if you instead get it via the <strong>AttributeHandler</strong> (or via <strong>.db</strong>), you are
|
||
bypassing this <strong>AttributeProperty</strong> entirely and this method is never reached.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NAttributeProperty">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">NAttributeProperty</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">autocreate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#NAttributeProperty"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NAttributeProperty" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty" title="evennia.typeclasses.attributes.AttributeProperty"><code class="xref py py-class docutils literal notranslate"><span class="pre">AttributeProperty</span></code></a></p>
|
||
<p>NAttribute property descriptor. Allows for specifying NAttributes as Django-like ‘fields’
|
||
on the class level.</p>
|
||
<p>Example:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">class</span><span class="w"> </span><span class="nc">Character</span><span class="p">(</span><span class="n">DefaultCharacter</span><span class="p">):</span>
|
||
<span class="n">foo</span> <span class="o">=</span> <span class="n">NAttributeProperty</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="s2">"Bar"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NAttributeProperty.attrhandler_name">
|
||
<span class="sig-name descname"><span class="pre">attrhandler_name</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'nattributes'</span></em><a class="headerlink" href="#evennia.typeclasses.attributes.NAttributeProperty.attrhandler_name" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">Attribute</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/evennia/typeclasses/attributes.html#Attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><code class="xref py py-class docutils literal notranslate"><span class="pre">IAttribute</span></code></a>, <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">SharedMemoryModel</span></code></a></p>
|
||
<p>This attribute is stored via Django. Most Attributes will be using this class.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_key">
|
||
<span class="sig-name descname"><span class="pre">db_key</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_key" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_value">
|
||
<span class="sig-name descname"><span class="pre">db_value</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_value" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_strvalue">
|
||
<span class="sig-name descname"><span class="pre">db_strvalue</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_strvalue" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_category">
|
||
<span class="sig-name descname"><span class="pre">db_category</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_category" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_lock_storage">
|
||
<span class="sig-name descname"><span class="pre">db_lock_storage</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_lock_storage" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_model">
|
||
<span class="sig-name descname"><span class="pre">db_model</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_model" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_attrtype">
|
||
<span class="sig-name descname"><span class="pre">db_attrtype</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_attrtype" title="Link 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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.db_date_created">
|
||
<span class="sig-name descname"><span class="pre">db_date_created</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.db_date_created" title="Link 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 property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.lock_storage">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">lock_storage</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.lock_storage" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.value">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">value</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.value" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Getter. Allows for <strong>value = self.value</strong>.
|
||
We cannot cache here since it makes certain cases (such
|
||
as storing a dbobj which is then deleted elsewhere) out-of-sync.
|
||
The overhead of unpickling seems hard to avoid.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.DoesNotExist">
|
||
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">DoesNotExist</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.DoesNotExist" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.utils.dbserialize.html#evennia.utils.dbserialize.ObjectDoesNotExist" title="django.core.exceptions.ObjectDoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectDoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.MultipleObjectsReturned">
|
||
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MultipleObjectsReturned</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.MultipleObjectsReturned" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.accountdb_set">
|
||
<span class="sig-name descname"><span class="pre">accountdb_set</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.accountdb_set" title="Link 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="w"> </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">'pizzas'</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 property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.attrtype">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">attrtype</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.attrtype" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_attrtype</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.category">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">category</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.category" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_category</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.channeldb_set">
|
||
<span class="sig-name descname"><span class="pre">channeldb_set</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.channeldb_set" title="Link 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="w"> </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">'pizzas'</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 property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.date_created">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">date_created</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.date_created" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_date_created</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.get_next_by_db_date_created">
|
||
<span class="sig-name descname"><span class="pre">get_next_by_db_date_created</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">field=<django.db.models.fields.DateTimeField:</span> <span class="pre">db_date_created></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_next=True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">**kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.get_next_by_db_date_created" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.get_previous_by_db_date_created">
|
||
<span class="sig-name descname"><span class="pre">get_previous_by_db_date_created</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">field=<django.db.models.fields.DateTimeField:</span> <span class="pre">db_date_created></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_next=False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">**kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.get_previous_by_db_date_created" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.id">
|
||
<span class="sig-name descname"><span class="pre">id</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.id" title="Link 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 property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.key">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">key</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.key" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_key</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.model">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">model</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.model" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_model</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.objectdb_set">
|
||
<span class="sig-name descname"><span class="pre">objectdb_set</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.objectdb_set" title="Link 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="w"> </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">'pizzas'</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 class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.path">
|
||
<span class="sig-name descname"><span class="pre">path</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'evennia.typeclasses.attributes.Attribute'</span></em><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.path" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.scriptdb_set">
|
||
<span class="sig-name descname"><span class="pre">scriptdb_set</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.scriptdb_set" title="Link 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="w"> </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">'pizzas'</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 property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.strvalue">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">strvalue</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.strvalue" title="Link to this definition">¶</a></dt>
|
||
<dd><p>A wrapper for getting database field <strong>db_strvalue</strong>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.Attribute.typename">
|
||
<span class="sig-name descname"><span class="pre">typename</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'SharedMemoryModelBase'</span></em><a class="headerlink" href="#evennia.typeclasses.attributes.Attribute.typename" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">IAttributeBackend</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>Abstract interface for the backends used by the Attribute Handler.</p>
|
||
<p>All Backends must implement this base class.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.query_all">
|
||
<span class="sig-name descname"><span class="pre">query_all</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.query_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.query_all" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Fetch all Attributes from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><em>attrlist (list)</em> – A list of Attribute objects.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.query_key">
|
||
<span class="sig-name descname"><span class="pre">query_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.query_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.query_key" title="Link to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The key of the Attribute being searched for.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category of the desired Attribute.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attribute (IAttribute)</em> – A single Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.query_category">
|
||
<span class="sig-name descname"><span class="pre">query_category</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.query_category"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.query_category" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Returns every matching Attribute as a list, given a category.</p>
|
||
<p>This method calls up whatever storage the backend uses.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category to query.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attrs (list)</em> – The discovered Attributes.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.get">
|
||
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.get" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Frontend for .get_cache. Retrieves Attribute(s).</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>optional</em>) – Attribute key to query for</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – Attribiute category</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>args (list)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>Returns a list of zero or more matches</dt><dd><p>found from cache or database.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.reset_cache">
|
||
<span class="sig-name descname"><span class="pre">reset_cache</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.reset_cache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.reset_cache" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Reset cache from the outside.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_create_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_create_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_create_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_create_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Does the hard work of actually creating Attributes, whatever is needed.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The Attribute’s key.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The Attribute’s category, or None</p></li>
|
||
<li><p><strong>lockstring</strong> (<em>str</em>) – Any locks for the Attribute.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value of the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – Signifies if this is a strvalue Attribute. Value MUST be a string or
|
||
this will lead to Trouble. Ignored for InMemory attributes.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attr (IAttribute)</em> – The new Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.create_attribute">
|
||
<span class="sig-name descname"><span class="pre">create_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cache</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.create_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.create_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Creates Attribute (using the class specified for the backend), (optionally) caches it, and
|
||
returns it.</p>
|
||
<p>This MUST actively save the Attribute to whatever database backend is used, AND
|
||
call self.set_cache(key, category, new_attrobj)</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The Attribute’s key.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The Attribute’s category, or None</p></li>
|
||
<li><p><strong>lockstring</strong> (<em>str</em>) – Any locks for the Attribute.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value of the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – Signifies if this is a strvalue Attribute. Value MUST be a string or
|
||
this will lead to Trouble. Ignored for InMemory attributes.</p></li>
|
||
<li><p><strong>cache</strong> (<em>bool</em>) – Whether to cache the new Attribute</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attr (IAttribute)</em> – The new Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Simply sets a new Value to an Attribute.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attribute being changed.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value for the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – If True, <strong>value</strong> is expected to be a string.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_batch_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_batch_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_storage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_batch_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Called opnly by batch add. For the database backend, this is a method
|
||
of updating that can alter category and lock-storage.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr_obj</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attribute being altered.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The attribute’s (new) category.</p></li>
|
||
<li><p><strong>lock_storage</strong> (<em>str</em>) – The attribute’s new locks.</p></li>
|
||
<li><p><strong>new_value</strong> (<em>obj</em>) – The Attribute’s new value.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – Signifies if this is a strvalue Attribute. Value MUST be a string or
|
||
this will lead to Trouble. Ignored for InMemory attributes.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_batch_finish">
|
||
<span class="sig-name descname"><span class="pre">do_batch_finish</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_objs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_batch_finish"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_finish" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Called after batch_add completed. Used for handling database operations
|
||
and/or caching complications.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr_objs</strong> (<em>list</em><em> of </em><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attributes created/updated thus far.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.batch_add">
|
||
<span class="sig-name descname"><span class="pre">batch_add</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/evennia/typeclasses/attributes.html#IAttributeBackend.batch_add"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.batch_add" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Batch-version of <strong>.add()</strong>. This is more efficient than repeat-calling
|
||
<strong>.add</strong> when having many Attributes to add.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>*args</strong> (<em>tuple</em>) – <p>Tuples of varying length representing the
|
||
Attribute to add to this object. Supported tuples are</p>
|
||
<ul class="simple">
|
||
<li><p>(key, value)</p></li>
|
||
<li><p>(key, value, category)</p></li>
|
||
<li><p>(key, value, category, lockstring)</p></li>
|
||
<li><p>(key, value, category, lockstring, default_access)</p></li>
|
||
</ul>
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><strong>RuntimeError</strong> – If trying to pass a non-iterable as argument.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>The indata tuple order matters, so if you want a lockstring but no
|
||
category, set the category to <strong>None</strong>. This method does not have the
|
||
ability to check editing permissions and is mainly used internally.
|
||
It does not use the normal <strong>self.add</strong> but applies the Attributes
|
||
directly to the database.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_delete_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_delete_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_delete_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_delete_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Does the hard work of actually deleting things.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The attribute to delete.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.delete_attribute">
|
||
<span class="sig-name descname"><span class="pre">delete_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.delete_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.delete_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Given an Attribute, deletes it. Also remove it from cache.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The attribute to delete.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.update_attribute">
|
||
<span class="sig-name descname"><span class="pre">update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Simply updates an Attribute.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The attribute to delete.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The new value.</p></li>
|
||
<li><p><strong>strattr</strong> (<em>bool</em>) – If set, the <strong>value</strong> is a raw string.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.do_batch_delete">
|
||
<span class="sig-name descname"><span class="pre">do_batch_delete</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_list</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.do_batch_delete"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_delete" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Given a list of attributes, deletes them all.
|
||
The default implementation is fine, but this is overridable since some databases may allow
|
||
for a better method.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attribute_list</strong> (<em>list</em><em> of </em><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>)</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.clear_attributes">
|
||
<span class="sig-name descname"><span class="pre">clear_attributes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.clear_attributes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.clear_attributes" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Remove all Attributes on this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – If given, clear only Attributes
|
||
of this category.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – If given, check the
|
||
<strong>attredit</strong> lock on each Attribute before continuing.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – Use this permission as
|
||
fallback if <strong>access_obj</strong> is given but there is no lock of
|
||
type <strong>attredit</strong> on the Attribute in question.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.IAttributeBackend.get_all_attributes">
|
||
<span class="sig-name descname"><span class="pre">get_all_attributes</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#IAttributeBackend.get_all_attributes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.IAttributeBackend.get_all_attributes" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Simply returns all Attributes of this object, sorted by their IDs.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>attributes (list of IAttribute)</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">InMemoryAttributeBackend</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend" title="evennia.typeclasses.attributes.IAttributeBackend"><code class="xref py py-class docutils literal notranslate"><span class="pre">IAttributeBackend</span></code></a></p>
|
||
<p>This Backend for Attributes stores NOTHING in the database. Everything is kept in memory, and
|
||
normally lost on a crash, reload, shared memory flush, etc. It generates IDs for the Attributes
|
||
it manages, but these are of little importance beyond sorting and satisfying the caching logic
|
||
to know an Attribute hasn’t been deleted out from under the cache’s nose.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.query_all">
|
||
<span class="sig-name descname"><span class="pre">query_all</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.query_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_all" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Fetch all Attributes from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><em>attrlist (list)</em> – A list of Attribute objects.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.query_key">
|
||
<span class="sig-name descname"><span class="pre">query_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.query_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_key" title="Link to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The key of the Attribute being searched for.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category of the desired Attribute.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attribute (IAttribute)</em> – A single Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.query_category">
|
||
<span class="sig-name descname"><span class="pre">query_category</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.query_category"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_category" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Returns every matching Attribute as a list, given a category.</p>
|
||
<p>This method calls up whatever storage the backend uses.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category to query.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attrs (list)</em> – The discovered Attributes.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.do_create_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_create_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.do_create_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_create_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>See parent class.</p>
|
||
<p>strvalue has no meaning for InMemory attributes.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.do_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.do_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Simply sets a new Value to an Attribute.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attribute being changed.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value for the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – If True, <strong>value</strong> is expected to be a string.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_batch_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_storage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.do_batch_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>No need to bother saving anything. Just set some values.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_finish">
|
||
<span class="sig-name descname"><span class="pre">do_batch_finish</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_objs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.do_batch_finish"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_finish" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Nothing to do here for In-Memory.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr_objs</strong> (<em>list</em><em> of </em><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attributes created/updated thus far.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.InMemoryAttributeBackend.do_delete_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_delete_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#InMemoryAttributeBackend.do_delete_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_delete_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Removes the Attribute from local storage. Once it’s out of the cache, garbage collection
|
||
will handle the rest.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The attribute to delete.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">ModelAttributeBackend</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend" title="evennia.typeclasses.attributes.IAttributeBackend"><code class="xref py py-class docutils literal notranslate"><span class="pre">IAttributeBackend</span></code></a></p>
|
||
<p>Uses Django models for storing Attributes.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handler</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrtype</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.query_all">
|
||
<span class="sig-name descname"><span class="pre">query_all</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.query_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_all" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Fetch all Attributes from this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><em>attrlist (list)</em> – A list of Attribute objects.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.query_key">
|
||
<span class="sig-name descname"><span class="pre">query_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.query_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_key" title="Link to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The key of the Attribute being searched for.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category of the desired Attribute.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attribute (IAttribute)</em> – A single Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.query_category">
|
||
<span class="sig-name descname"><span class="pre">query_category</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.query_category"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_category" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Returns every matching Attribute as a list, given a category.</p>
|
||
<p>This method calls up whatever storage the backend uses.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The category to query.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attrs (list)</em> – The discovered Attributes.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.do_create_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_create_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.do_create_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_create_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Does the hard work of actually creating Attributes, whatever is needed.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – The Attribute’s key.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The Attribute’s category, or None</p></li>
|
||
<li><p><strong>lockstring</strong> (<em>str</em>) – Any locks for the Attribute.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value of the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – Signifies if this is a strvalue Attribute. Value MUST be a string or
|
||
this will lead to Trouble. Ignored for InMemory attributes.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>attr (IAttribute)</em> – The new Attribute.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.do_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.do_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Simply sets a new Value to an Attribute.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attribute being changed.</p></li>
|
||
<li><p><strong>value</strong> (<em>obj</em>) – The Value for the Attribute.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – If True, <strong>value</strong> is expected to be a string.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_update_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_batch_update_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lock_storage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strvalue</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.do_batch_update_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_update_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Called opnly by batch add. For the database backend, this is a method
|
||
of updating that can alter category and lock-storage.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>attr_obj</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attribute being altered.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – The attribute’s (new) category.</p></li>
|
||
<li><p><strong>lock_storage</strong> (<em>str</em>) – The attribute’s new locks.</p></li>
|
||
<li><p><strong>new_value</strong> (<em>obj</em>) – The Attribute’s new value.</p></li>
|
||
<li><p><strong>strvalue</strong> (<em>bool</em>) – Signifies if this is a strvalue Attribute. Value MUST be a string or
|
||
this will lead to Trouble. Ignored for InMemory attributes.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_finish">
|
||
<span class="sig-name descname"><span class="pre">do_batch_finish</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_objs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.do_batch_finish"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_finish" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Called after batch_add completed. Used for handling database operations
|
||
and/or caching complications.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr_objs</strong> (<em>list</em><em> of </em><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The Attributes created/updated thus far.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.ModelAttributeBackend.do_delete_attribute">
|
||
<span class="sig-name descname"><span class="pre">do_delete_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#ModelAttributeBackend.do_delete_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_delete_attribute" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Does the hard work of actually deleting things.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>attr</strong> (<a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute" title="evennia.typeclasses.attributes.IAttribute"><em>IAttribute</em></a>) – The attribute to delete.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">AttributeHandler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">backend_class</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>Handler for adding Attributes to the object.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">backend_class</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Setup the AttributeHandler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>obj</strong> (<a class="reference internal" href="evennia.accounts.models.html#evennia.accounts.models.TypedObject" title="evennia.accounts.models.TypedObject"><em>TypedObject</em></a>) – An Account, Object, Channel, ServerSession (not technically a typed
|
||
object), etc. backend_class (IAttributeBackend class): The class of the backend to
|
||
use.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.has">
|
||
<span class="sig-name descname"><span class="pre">has</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.has"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.has" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Checks if the given Attribute (or list of Attributes) exists on
|
||
the object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em> or </em><em>iterable</em>) – The Attribute key or keys to check for.
|
||
If <strong>None</strong>, search by category.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>None</em>) – Limit the check to Attributes with this
|
||
category (note, that <strong>None</strong> is the default category).</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>has_attribute (bool or list)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>If the Attribute exists on</dt><dd><p>this object or not. If <strong>key</strong> was given as an iterable then
|
||
the return is a list of booleans.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.get">
|
||
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_exception</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_list</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.get" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Get the Attribute.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – the attribute identifier or
|
||
multiple attributes to get. if a list of keys, the
|
||
method will return a list.</p></li>
|
||
<li><p><strong>default</strong> (<em>any</em><em>, </em><em>optional</em>) – The value to return if an
|
||
Attribute was not defined. If set, it will be returned in
|
||
a one-item list.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – the category within which to
|
||
retrieve attribute(s).</p></li>
|
||
<li><p><strong>return_obj</strong> (<em>bool</em><em>, </em><em>optional</em>) – If set, the return is not the value of the
|
||
Attribute but the Attribute object itself.</p></li>
|
||
<li><p><strong>strattr</strong> (<em>bool</em><em>, </em><em>optional</em>) – Return the <strong>strvalue</strong> field of
|
||
the Attribute rather than the usual <strong>value</strong>, this is a
|
||
string-only value for quick database searches.</p></li>
|
||
<li><p><strong>raise_exception</strong> (<em>bool</em><em>, </em><em>optional</em>) – When an Attribute is not
|
||
found, the return from this is usually <strong>default</strong>. If this
|
||
is set, an exception is raised instead.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – If set, an <strong>attrread</strong>
|
||
permission lock will be checked before returning each
|
||
looked-after Attribute.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – If no <strong>attrread</strong> lock is set on
|
||
object, this determines if the lock should then be passed or not.</p></li>
|
||
<li><p><strong>return_list</strong> (<em>bool</em><em>, </em><em>optional</em>) – Always return a list, also if there is only
|
||
one or zero matches found.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>result (any or list)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>One or more matches for keys and/or</dt><dd><p>categories. Each match will be the value of the found Attribute(s)
|
||
unless <strong>return_obj</strong> is True, at which point it will be the
|
||
attribute object itself or None. If <strong>return_list</strong> is True, this
|
||
will always be a list, regardless of the number of elements.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>AttributeError</strong> – If <strong>raise_exception</strong> is set and no matching Attribute
|
||
was found matching <strong>key</strong>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.add">
|
||
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lockstring</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strattr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.add"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.add" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Add attribute to object, with optional <strong>lockstring</strong>.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – An Attribute name to add.</p></li>
|
||
<li><p><strong>value</strong> (<em>any</em><em> or </em><em>str</em>) – The value of the Attribute. If
|
||
<strong>strattr</strong> keyword is set, this <em>must</em> be a string.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category for the Attribute.
|
||
The default <strong>None</strong> is the normal category used.</p></li>
|
||
<li><p><strong>lockstring</strong> (<em>str</em><em>, </em><em>optional</em>) – A lock string limiting access
|
||
to the attribute.</p></li>
|
||
<li><p><strong>strattr</strong> (<em>bool</em><em>, </em><em>optional</em>) – Make this a string-only Attribute.
|
||
This is only ever useful for optimization purposes.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – An entity to check for
|
||
the <strong>attrcreate</strong> access-type. If not passing, this method
|
||
will be exited.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – What access to grant if
|
||
<strong>accessing_obj</strong> is given but no lock of the type
|
||
<strong>attrcreate</strong> is defined on the Attribute in question.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.batch_add">
|
||
<span class="sig-name descname"><span class="pre">batch_add</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/evennia/typeclasses/attributes.html#AttributeHandler.batch_add"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.batch_add" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Batch-version of <strong>add()</strong>. This is more efficient than
|
||
repeat-calling add when having many Attributes to add.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>*args</strong> (<em>tuple</em>) – <p>Each argument should be a tuples (can be of varying
|
||
length) representing the Attribute to add to this object.
|
||
Supported tuples are</p>
|
||
<ul class="simple">
|
||
<li><p>(key, value)</p></li>
|
||
<li><p>(key, value, category)</p></li>
|
||
<li><p>(key, value, category, lockstring)</p></li>
|
||
<li><p>(key, value, category, lockstring, default_access)</p></li>
|
||
</ul>
|
||
</p>
|
||
</dd>
|
||
<dt class="field-even">Keyword Arguments<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><strong>strattr</strong> (<em>bool</em>) – If <strong>True</strong>, value must be a string. This
|
||
will save the value without pickling which is less
|
||
flexible but faster to search (not often used except
|
||
internally).</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>RuntimeError</strong> – If trying to pass a non-iterable as argument.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>The indata tuple order matters, so if you want a lockstring
|
||
but no category, set the category to <strong>None</strong>. This method
|
||
does not have the ability to check editing permissions like
|
||
normal .add does, and is mainly used internally. It does not
|
||
use the normal self.add but apply the Attributes directly
|
||
to the database.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.remove">
|
||
<span class="sig-name descname"><span class="pre">remove</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_exception</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.remove"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.remove" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Remove attribute or a list of attributes from object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – An Attribute key to remove or a list of keys. If
|
||
multiple keys, they must all be of the same <strong>category</strong>. If None and
|
||
category is not given, remove all Attributes.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category within which to
|
||
remove the Attribute.</p></li>
|
||
<li><p><strong>raise_exception</strong> (<em>bool</em><em>, </em><em>optional</em>) – If set, not finding the
|
||
Attribute to delete will raise an exception instead of
|
||
just quietly failing.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – An object to check
|
||
against the <strong>attredit</strong> lock. If not given, the check will
|
||
be skipped.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – The fallback access to
|
||
grant if <strong>accessing_obj</strong> is given but there is no
|
||
<strong>attredit</strong> lock set on the Attribute in question.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><strong>AttributeError</strong> – If <strong>raise_exception</strong> is set and no matching Attribute
|
||
was found matching <strong>key</strong>.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>If neither key nor category is given, this acts as clear().</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.clear">
|
||
<span class="sig-name descname"><span class="pre">clear</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.clear"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.clear" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Remove all Attributes on this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – If given, clear only Attributes
|
||
of this category.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – If given, check the
|
||
<strong>attredit</strong> lock on each Attribute before continuing.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – Use this permission as
|
||
fallback if <strong>access_obj</strong> is given but there is no lock of
|
||
type <strong>attredit</strong> on the Attribute in question.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.all">
|
||
<span class="sig-name descname"><span class="pre">all</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accessing_obj</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default_access</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.all" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Return all Attribute objects on this object, regardless of category.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – A given category to limit results to.</p></li>
|
||
<li><p><strong>accessing_obj</strong> (<em>object</em><em>, </em><em>optional</em>) – Check the <strong>attrread</strong>
|
||
lock on each attribute before returning them. If not
|
||
given, this check is skipped.</p></li>
|
||
<li><p><strong>default_access</strong> (<em>bool</em><em>, </em><em>optional</em>) – Use this permission as a
|
||
fallback if <strong>accessing_obj</strong> is given but one or more
|
||
Attributes has no lock of type <strong>attrread</strong> defined on them.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>Attributes (list)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>All the Attribute objects (note: Not</dt><dd><p>their values!) in the handler.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.AttributeHandler.reset_cache">
|
||
<span class="sig-name descname"><span class="pre">reset_cache</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#AttributeHandler.reset_cache"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.AttributeHandler.reset_cache" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.DbHolder">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">DbHolder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">manager_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'attributes'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#DbHolder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.DbHolder" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>Holder for allowing property access of attributes</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.DbHolder.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">manager_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'attributes'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#DbHolder.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.DbHolder.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.DbHolder.get_all">
|
||
<span class="sig-name descname"><span class="pre">get_all</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#DbHolder.get_all"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.DbHolder.get_all" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py property">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.DbHolder.all">
|
||
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">all</span></span><a class="headerlink" href="#evennia.typeclasses.attributes.DbHolder.all" title="Link to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickTemplateInvalid">
|
||
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">NickTemplateInvalid</span></span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#NickTemplateInvalid"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickTemplateInvalid" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ValueError</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.initialize_nick_templates">
|
||
<span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">initialize_nick_templates</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pattern</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">replacement</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pattern_is_regex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#initialize_nick_templates"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.initialize_nick_templates" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Initialize the nick templates for matching and remapping a string.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>pattern</strong> (<em>str</em>) – The pattern to be used for nick recognition. This will
|
||
be parsed for shell patterns into a regex, unless <strong>pattern_is_regex</strong>
|
||
is <strong>True</strong>, in which case it must be an already valid regex string. In
|
||
this case, instead of <strong>$N</strong>, numbered arguments must instead be given
|
||
as matching groups named as <strong>argN</strong>, such as <strong>(?P<arg1>.+?)</strong>.</p></li>
|
||
<li><p><strong>replacement</strong> (<em>str</em>) – The template to be used to replace the string
|
||
matched by the pattern. This can contain <strong>$N</strong> markers and is never
|
||
parsed into a regex.</p></li>
|
||
<li><p><strong>pattern_is_regex</strong> (<em>bool</em>) – If set, <strong>pattern</strong> is a full regex string
|
||
instead of containing shell patterns.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>regex, template (str)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>Regex to match against strings and template</dt><dd><p>with markers <strong>**{arg1}, {arg2}**</strong>, etc for replacement using the standard
|
||
<strong>.format</strong> method.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>evennia.typecalasses.attributes.NickTemplateInvalid</strong> – If the in/out</p></li>
|
||
<li><p><strong>template does not have a matching number</strong><strong> of </strong><strong>$args.</strong> – </p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Examples</p>
|
||
<ul class="simple">
|
||
<li><p><strong>pattern</strong> (shell syntax): <strong>“grin $1”</strong></p></li>
|
||
<li><p><strong>pattern</strong> (regex): <strong>“grin (?P<arg1.+?>)”</strong></p></li>
|
||
<li><p><strong>replacement</strong>: <strong>“emote gives a wicked grin to $1”</strong></p></li>
|
||
</ul>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.parse_nick_template">
|
||
<span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">parse_nick_template</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">template_regex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outtemplate</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#parse_nick_template"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.parse_nick_template" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Parse a text using a template and map it to another template</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>string</strong> (<em>str</em>) – The input string to process</p></li>
|
||
<li><p><strong>template_regex</strong> (<em>regex</em>) – A template regex created with
|
||
initialize_nick_template.</p></li>
|
||
<li><p><strong>outtemplate</strong> (<em>str</em>) – The template to which to map the matches
|
||
produced by the template_regex. This should have $1, $2,
|
||
etc to match the template-regex. Un-found $N-markers (possible if
|
||
the regex has optional matching groups) are replaced with empty
|
||
strings.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler">
|
||
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">evennia.typeclasses.attributes.</span></span><span class="sig-name descname"><span class="pre">NickHandler</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/evennia/typeclasses/attributes.html#NickHandler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler" title="evennia.typeclasses.attributes.AttributeHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">AttributeHandler</span></code></a></p>
|
||
<p>Handles the addition and removal of Nicks. Nicks are special
|
||
versions of Attributes with an <strong>_attrtype</strong> hardcoded to <strong>nick</strong>.
|
||
They also always use the <strong>strvalue</strong> fields for their data.</p>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.__init__">
|
||
<span class="sig-name descname"><span class="pre">__init__</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/evennia/typeclasses/attributes.html#NickHandler.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.__init__" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Setup the AttributeHandler.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>obj</strong> (<a class="reference internal" href="evennia.accounts.models.html#evennia.accounts.models.TypedObject" title="evennia.accounts.models.TypedObject"><em>TypedObject</em></a>) – An Account, Object, Channel, ServerSession (not technically a typed
|
||
object), etc. backend_class (IAttributeBackend class): The class of the backend to
|
||
use.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.has">
|
||
<span class="sig-name descname"><span class="pre">has</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'inputline'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#NickHandler.has"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.has" title="Link to this definition">¶</a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em> or </em><em>iterable</em>) – The Nick key or keys to check for.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em>) – Limit the check to Nicks with this
|
||
category (note, that <strong>None</strong> is the default category).</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>has_nick (bool or list)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>If the Nick exists on this object</dt><dd><p>or not. If <strong>key</strong> was given as an iterable then the return
|
||
is a list of booleans.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.get">
|
||
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'inputline'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_tuple</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</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/evennia/typeclasses/attributes.html#NickHandler.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.get" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Get the replacement value matching the given key and category</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – the attribute identifier or
|
||
multiple attributes to get. if a list of keys, the
|
||
method will return a list.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – the category within which to
|
||
retrieve the nick. The “inputline” means replacing data
|
||
sent by the user.</p></li>
|
||
<li><p><strong>return_tuple</strong> (<em>bool</em><em>, </em><em>optional</em>) – return the full nick tuple rather
|
||
than just the replacement. For non-template nicks this is just
|
||
a string.</p></li>
|
||
<li><p><strong>kwargs</strong> (<em>any</em><em>, </em><em>optional</em>) – These are passed on to <strong>AttributeHandler.get</strong>.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><em>str or tuple</em> – The nick replacement string or nick tuple.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.add">
|
||
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pattern</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">replacement</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'inputline'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pattern_is_regex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</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/evennia/typeclasses/attributes.html#NickHandler.add"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.add" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Add a new nick, a mapping pattern -> replacement.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>pattern</strong> (<em>str</em>) – A pattern to match for. This will be parsed for
|
||
shell patterns using the <strong>fnmatch</strong> library and can contain
|
||
<strong>$N</strong>-markers to indicate the locations of arguments to catch. If
|
||
<strong>pattern_is_regex=True</strong>, this must instead be a valid regular
|
||
expression and the <strong>$N</strong>-markers must be named <strong>argN</strong> that matches
|
||
numbered regex groups (see examples).</p></li>
|
||
<li><p><strong>replacement</strong> (<em>str</em>) – The string (or template) to replace <strong>key</strong> with
|
||
(the “nickname”). This may contain <strong>$N</strong> markers to indicate where to
|
||
place the argument-matches</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – the category within which to
|
||
retrieve the nick. The “inputline” means replacing data
|
||
sent by the user.</p></li>
|
||
<li><p><strong>pattern_is_regex</strong> (<em>bool</em>) – If <strong>True</strong>, the <strong>pattern</strong> will be parsed as a
|
||
raw regex string. Instead of using <strong>$N</strong> markers in this string, one
|
||
then must mark numbered arguments as a named regex-groupd named <strong>argN</strong>.
|
||
For example, <strong>(?P<arg1>.+?)</strong> will match the behavior of using <strong>$1</strong>
|
||
in the shell pattern.</p></li>
|
||
<li><p><strong>**kwargs</strong> (<em>any</em><em>, </em><em>optional</em>) – These are passed on to <strong>AttributeHandler.get</strong>.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>For most cases, the shell-pattern is much shorter and easier. The
|
||
regex pattern form can be useful for more complex matchings though,
|
||
for example in order to add optional arguments, such as with
|
||
<strong>(?P<argN>.*?)</strong>.</p>
|
||
<p class="rubric">Example</p>
|
||
<ul class="simple">
|
||
<li><p>pattern (default shell syntax): <strong>“gr $1 at $2”</strong></p></li>
|
||
<li><p>pattern (with pattern_is_regex=True): <strong>r”gr (?P<arg1>.+?) at (?P<arg2>.+?)”</strong></p></li>
|
||
<li><p>replacement: <strong>“emote With a flourish, $1 grins at $2.”</strong></p></li>
|
||
</ul>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.remove">
|
||
<span class="sig-name descname"><span class="pre">remove</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'inputline'</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/evennia/typeclasses/attributes.html#NickHandler.remove"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.remove" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Remove Nick with matching category.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>key</strong> (<em>str</em>) – A key for the nick to match for.</p></li>
|
||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – the category within which to
|
||
removethe nick. The “inputline” means replacing data
|
||
sent by the user.</p></li>
|
||
<li><p><strong>kwargs</strong> (<em>any</em><em>, </em><em>optional</em>) – These are passed on to <strong>AttributeHandler.get</strong>.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="evennia.typeclasses.attributes.NickHandler.nickreplace">
|
||
<span class="sig-name descname"><span class="pre">nickreplace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">raw_string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">categories</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">('inputline',</span> <span class="pre">'channel')</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_account</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/typeclasses/attributes.html#NickHandler.nickreplace"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#evennia.typeclasses.attributes.NickHandler.nickreplace" title="Link to this definition">¶</a></dt>
|
||
<dd><p>Apply nick replacement of entries in raw_string with nick replacement.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>raw_string</strong> (<em>str</em>) – The string in which to perform nick
|
||
replacement.</p></li>
|
||
<li><p><strong>categories</strong> (<em>tuple</em><em>, </em><em>optional</em>) – Replacement categories in
|
||
which to perform the replacement, such as “inputline”,
|
||
“channel” etc.</p></li>
|
||
<li><p><strong>include_account</strong> (<em>bool</em><em>, </em><em>optional</em>) – Also include replacement
|
||
with nicks stored on the Account level.</p></li>
|
||
<li><p><strong>kwargs</strong> (<em>any</em><em>, </em><em>optional</em>) – Not used.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p><p><em>string (str)</em> –</p>
|
||
<dl class="simple">
|
||
<dt>A string with matching keys replaced with</dt><dd><p>their nick equivalents.</p>
|
||
</dd>
|
||
</dl>
|
||
</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</section>
|
||
|
||
|
||
<div class="clearer"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo of Evennia"/>
|
||
</a></p>
|
||
<search 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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</search>
|
||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||
<h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">evennia.typeclasses.attributes</a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute"><code class="docutils literal notranslate"><span class="pre">IAttribute</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.locks"><code class="docutils literal notranslate"><span class="pre">IAttribute.locks</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.key"><code class="docutils literal notranslate"><span class="pre">IAttribute.key</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.strvalue"><code class="docutils literal notranslate"><span class="pre">IAttribute.strvalue</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.category"><code class="docutils literal notranslate"><span class="pre">IAttribute.category</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.model"><code class="docutils literal notranslate"><span class="pre">IAttribute.model</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.attrtype"><code class="docutils literal notranslate"><span class="pre">IAttribute.attrtype</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.date_created"><code class="docutils literal notranslate"><span class="pre">IAttribute.date_created</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.lock_storage"><code class="docutils literal notranslate"><span class="pre">IAttribute.lock_storage</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttribute.access"><code class="docutils literal notranslate"><span class="pre">IAttribute.access()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttribute"><code class="docutils literal notranslate"><span class="pre">InMemoryAttribute</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttribute.__init__"><code class="docutils literal notranslate"><span class="pre">InMemoryAttribute.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttribute.value"><code class="docutils literal notranslate"><span class="pre">InMemoryAttribute.value</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty"><code class="docutils literal notranslate"><span class="pre">AttributeProperty</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty.attrhandler_name"><code class="docutils literal notranslate"><span class="pre">AttributeProperty.attrhandler_name</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty.cached_default_name_template"><code class="docutils literal notranslate"><span class="pre">AttributeProperty.cached_default_name_template</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty.__init__"><code class="docutils literal notranslate"><span class="pre">AttributeProperty.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty.at_set"><code class="docutils literal notranslate"><span class="pre">AttributeProperty.at_set()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeProperty.at_get"><code class="docutils literal notranslate"><span class="pre">AttributeProperty.at_get()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NAttributeProperty"><code class="docutils literal notranslate"><span class="pre">NAttributeProperty</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NAttributeProperty.attrhandler_name"><code class="docutils literal notranslate"><span class="pre">NAttributeProperty.attrhandler_name</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute"><code class="docutils literal notranslate"><span class="pre">Attribute</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_key"><code class="docutils literal notranslate"><span class="pre">Attribute.db_key</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_value"><code class="docutils literal notranslate"><span class="pre">Attribute.db_value</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_strvalue"><code class="docutils literal notranslate"><span class="pre">Attribute.db_strvalue</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_category"><code class="docutils literal notranslate"><span class="pre">Attribute.db_category</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_lock_storage"><code class="docutils literal notranslate"><span class="pre">Attribute.db_lock_storage</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_model"><code class="docutils literal notranslate"><span class="pre">Attribute.db_model</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_attrtype"><code class="docutils literal notranslate"><span class="pre">Attribute.db_attrtype</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.db_date_created"><code class="docutils literal notranslate"><span class="pre">Attribute.db_date_created</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.lock_storage"><code class="docutils literal notranslate"><span class="pre">Attribute.lock_storage</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.value"><code class="docutils literal notranslate"><span class="pre">Attribute.value</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.DoesNotExist"><code class="docutils literal notranslate"><span class="pre">Attribute.DoesNotExist</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.MultipleObjectsReturned"><code class="docutils literal notranslate"><span class="pre">Attribute.MultipleObjectsReturned</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.accountdb_set"><code class="docutils literal notranslate"><span class="pre">Attribute.accountdb_set</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.attrtype"><code class="docutils literal notranslate"><span class="pre">Attribute.attrtype</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.category"><code class="docutils literal notranslate"><span class="pre">Attribute.category</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.channeldb_set"><code class="docutils literal notranslate"><span class="pre">Attribute.channeldb_set</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.date_created"><code class="docutils literal notranslate"><span class="pre">Attribute.date_created</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.get_next_by_db_date_created"><code class="docutils literal notranslate"><span class="pre">Attribute.get_next_by_db_date_created()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.get_previous_by_db_date_created"><code class="docutils literal notranslate"><span class="pre">Attribute.get_previous_by_db_date_created()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.id"><code class="docutils literal notranslate"><span class="pre">Attribute.id</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.key"><code class="docutils literal notranslate"><span class="pre">Attribute.key</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.model"><code class="docutils literal notranslate"><span class="pre">Attribute.model</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.objectdb_set"><code class="docutils literal notranslate"><span class="pre">Attribute.objectdb_set</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.path"><code class="docutils literal notranslate"><span class="pre">Attribute.path</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.scriptdb_set"><code class="docutils literal notranslate"><span class="pre">Attribute.scriptdb_set</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.strvalue"><code class="docutils literal notranslate"><span class="pre">Attribute.strvalue</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.Attribute.typename"><code class="docutils literal notranslate"><span class="pre">Attribute.typename</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.__init__"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.query_all"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.query_all()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.query_key"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.query_key()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.query_category"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.query_category()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.get"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.get()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.reset_cache"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.reset_cache()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_create_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_create_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.create_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.create_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_update_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_update_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_batch_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_finish"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_batch_finish()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.batch_add"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.batch_add()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_delete_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_delete_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.delete_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.delete_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.update_attribute"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.do_batch_delete"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.do_batch_delete()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.clear_attributes"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.clear_attributes()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.IAttributeBackend.get_all_attributes"><code class="docutils literal notranslate"><span class="pre">IAttributeBackend.get_all_attributes()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.__init__"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_all"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.query_all()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_key"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.query_key()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.query_category"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.query_category()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_create_attribute"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.do_create_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_update_attribute"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.do_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_update_attribute"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.do_batch_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_batch_finish"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.do_batch_finish()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.InMemoryAttributeBackend.do_delete_attribute"><code class="docutils literal notranslate"><span class="pre">InMemoryAttributeBackend.do_delete_attribute()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.__init__"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_all"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.query_all()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_key"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.query_key()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.query_category"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.query_category()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_create_attribute"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.do_create_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_update_attribute"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.do_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_update_attribute"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.do_batch_update_attribute()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_batch_finish"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.do_batch_finish()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.ModelAttributeBackend.do_delete_attribute"><code class="docutils literal notranslate"><span class="pre">ModelAttributeBackend.do_delete_attribute()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler"><code class="docutils literal notranslate"><span class="pre">AttributeHandler</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.__init__"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.has"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.has()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.get"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.get()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.add"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.add()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.batch_add"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.batch_add()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.remove"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.remove()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.clear"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.clear()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.all"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.all()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.AttributeHandler.reset_cache"><code class="docutils literal notranslate"><span class="pre">AttributeHandler.reset_cache()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.DbHolder"><code class="docutils literal notranslate"><span class="pre">DbHolder</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.DbHolder.__init__"><code class="docutils literal notranslate"><span class="pre">DbHolder.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.DbHolder.get_all"><code class="docutils literal notranslate"><span class="pre">DbHolder.get_all()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.DbHolder.all"><code class="docutils literal notranslate"><span class="pre">DbHolder.all</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickTemplateInvalid"><code class="docutils literal notranslate"><span class="pre">NickTemplateInvalid</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.initialize_nick_templates"><code class="docutils literal notranslate"><span class="pre">initialize_nick_templates()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.parse_nick_template"><code class="docutils literal notranslate"><span class="pre">parse_nick_template()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler"><code class="docutils literal notranslate"><span class="pre">NickHandler</span></code></a><ul>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.__init__"><code class="docutils literal notranslate"><span class="pre">NickHandler.__init__()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.has"><code class="docutils literal notranslate"><span class="pre">NickHandler.has()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.get"><code class="docutils literal notranslate"><span class="pre">NickHandler.get()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.add"><code class="docutils literal notranslate"><span class="pre">NickHandler.add()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.remove"><code class="docutils literal notranslate"><span class="pre">NickHandler.remove()</span></code></a></li>
|
||
<li><a class="reference internal" href="#evennia.typeclasses.attributes.NickHandler.nickreplace"><code class="docutils literal notranslate"><span class="pre">NickHandler.nickreplace()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<div>
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="evennia.typeclasses.html"
|
||
title="previous chapter">evennia.typeclasses</a></p>
|
||
</div>
|
||
<div>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="evennia.typeclasses.managers.html"
|
||
title="next chapter">evennia.typeclasses.managers</a></p>
|
||
</div>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/api/evennia.typeclasses.attributes.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
|
||
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
|
||
<li><a href="https://github.com/evennia/evennia">Github</a> </li>
|
||
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
||
<li>
|
||
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
|
||
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
|
||
<a href="https://evennia.blogspot.com/">Blog</a>
|
||
</li>
|
||
</ul>
|
||
<h3>Doc Versions</h3>
|
||
<ul>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/latest/index.html">latest (main branch)</a>
|
||
</li>
|
||
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/5.x/index.html">v5.0.0 branch (outdated)</a>
|
||
</li>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/4.x/index.html">v4.0.0 branch (outdated)</a>
|
||
</li>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/3.x/index.html">v3.0.0 branch (outdated)</a>
|
||
</li>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/2.x/index.html">v2.0.0 branch (outdated)</a>
|
||
</li>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/1.x/index.html">v1.0.0 branch (outdated)</a>
|
||
</li>
|
||
|
||
<li>
|
||
<a href="https://www.evennia.com/docs/0.x/index.html">v0.9.5 branch (outdated)</a>
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="Related">
|
||
<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="right" >
|
||
<a href="evennia.typeclasses.managers.html" title="evennia.typeclasses.managers"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="evennia.typeclasses.html" title="evennia.typeclasses"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../Evennia-API.html" >API Summary</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="evennia-api.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="evennia.html" >evennia</a> »</li>
|
||
<li class="nav-item nav-item-4"><a href="evennia.typeclasses.html" >evennia.typeclasses</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.typeclasses.attributes</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2024, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.
|
||
</div>
|
||
</body>
|
||
</html> |