mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 20:47:17 +02:00
Updated HTML docs
This commit is contained in:
parent
86fb09d6bf
commit
86c930be7a
1221 changed files with 76528 additions and 29095 deletions
|
|
@ -30,6 +30,7 @@
|
|||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">evennia.web.admin.attributes</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
|
|
@ -37,8 +38,151 @@
|
|||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<section id="evennia-web-admin-attributes">
|
||||
<h1>evennia.web.admin.attributes<a class="headerlink" href="#evennia-web-admin-attributes" title="Permalink to this headline">¶</a></h1>
|
||||
<section id="module-evennia.web.admin.attributes">
|
||||
<span id="evennia-web-admin-attributes"></span><h1>evennia.web.admin.attributes<a class="headerlink" href="#module-evennia.web.admin.attributes" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Attribute admin.</p>
|
||||
<p>Note that we don’t present a separate admin for these, since they are only
|
||||
relevant together with a specific object.</p>
|
||||
<dl class="py class">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.web.admin.attributes.</code><code class="sig-name descname">AttributeForm</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeForm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">django.forms.models.ModelForm</span></code></p>
|
||||
<p>This form overrides the base behavior of the ModelForm that would be used for a Attribute-through-model.
|
||||
Since the through-models only have access to the foreignkeys of the Attribute and the Object that they’re
|
||||
attached to, we need to spoof the behavior of it being a form that would correspond to its Attribute,
|
||||
or the creation of an Attribute. Instead of being saved, we’ll call to the Object’s handler, which will handle
|
||||
the creation, change, or deletion of an Attribute for us, as well as updating the handler’s cache so that all
|
||||
changes are instantly updated in-game.</p>
|
||||
<dl class="py class">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.Meta">
|
||||
<em class="property">class </em><code class="sig-name descname">Meta</code><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeForm.Meta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.Meta" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.Meta.fields">
|
||||
<code class="sig-name descname">fields</code><em class="property"> = ('attr_key', 'attr_value', 'attr_category', 'attr_lockstring', 'attr_type')</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.Meta.fields" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.__init__">
|
||||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeForm.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>If we have an Attribute, then we’ll prepopulate our instance with the fields we’d expect it
|
||||
to have based on the Attribute. attr_key, attr_category, attr_value, attr_type,
|
||||
and attr_lockstring all refer to the corresponding Attribute fields. The initial data of the form fields will
|
||||
similarly be populated.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.save">
|
||||
<code class="sig-name descname">save</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">commit</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeForm.save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.save" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>One thing we want to do here is the or None checks, because forms are saved with an empty
|
||||
string rather than null from forms, usually, and the Handlers may handle empty strings
|
||||
differently than None objects. So for consistency with how things are handled in game,
|
||||
we’ll try to make sure that empty form fields will be None, rather than ‘’.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.clean_attr_value">
|
||||
<code class="sig-name descname">clean_attr_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeForm.clean_attr_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.clean_attr_value" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Prevent certain data-types from being cleaned due to literal_eval
|
||||
failing on them. Otherwise they will be turned into str.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.base_fields">
|
||||
<code class="sig-name descname">base_fields</code><em class="property"> = {'attr_category': <django.forms.fields.CharField object>, 'attr_key': <django.forms.fields.CharField object>, 'attr_lockstring': <django.forms.fields.CharField object>, 'attr_type': <django.forms.fields.ChoiceField object>, 'attr_value': <evennia.utils.picklefield.PickledFormField object>}</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.base_fields" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.declared_fields">
|
||||
<code class="sig-name descname">declared_fields</code><em class="property"> = {'attr_category': <django.forms.fields.CharField object>, 'attr_key': <django.forms.fields.CharField object>, 'attr_lockstring': <django.forms.fields.CharField object>, 'attr_type': <django.forms.fields.ChoiceField object>, 'attr_value': <evennia.utils.picklefield.PickledFormField object>}</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.declared_fields" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeForm.media">
|
||||
<em class="property">property </em><code class="sig-name descname">media</code><a class="headerlink" href="#evennia.web.admin.attributes.AttributeForm.media" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return all media required to render the widgets on this form.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class">
|
||||
<dt id="evennia.web.admin.attributes.AttributeFormSet">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.web.admin.attributes.</code><code class="sig-name descname">AttributeFormSet</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">files</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">instance</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">save_as_new</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">prefix</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">queryset</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeFormSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeFormSet" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">django.forms.models.BaseInlineFormSet</span></code></p>
|
||||
<p>Attribute version of TagFormSet, as above.</p>
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeFormSet.save">
|
||||
<code class="sig-name descname">save</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">commit</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeFormSet.save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeFormSet.save" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save model instances for every form, adding and changing instances
|
||||
as necessary, and return the list of instances.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py class">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">evennia.web.admin.attributes.</code><code class="sig-name descname">AttributeInline</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parent_model</span></em>, <em class="sig-param"><span class="n">admin_site</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeInline"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">django.contrib.admin.options.TabularInline</span></code></p>
|
||||
<p>A handler for inline Attributes. This class should be subclassed in the admin of your models,
|
||||
and the ‘model’ and ‘related_field’ class attributes must be set. model should be the
|
||||
through model (ObjectDB_db_tag’, for example), while related field should be the name
|
||||
of the field on that through model which points to the model being used: ‘objectdb’,
|
||||
‘msg’, ‘accountdb’, etc.</p>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.model">
|
||||
<code class="sig-name descname">model</code><em class="property"> = None</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.model" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.verbose_name">
|
||||
<code class="sig-name descname">verbose_name</code><em class="property"> = 'Attribute'</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.verbose_name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.verbose_name_plural">
|
||||
<code class="sig-name descname">verbose_name_plural</code><em class="property"> = 'Attributes'</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.verbose_name_plural" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.form">
|
||||
<code class="sig-name descname">form</code><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.form" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>alias of <a class="reference internal" href="#evennia.web.admin.attributes.AttributeForm" title="evennia.web.admin.attributes.AttributeForm"><code class="xref py py-class docutils literal notranslate"><span class="pre">AttributeForm</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.formset">
|
||||
<code class="sig-name descname">formset</code><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.formset" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>alias of <a class="reference internal" href="#evennia.web.admin.attributes.AttributeFormSet" title="evennia.web.admin.attributes.AttributeFormSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">AttributeFormSet</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.related_field">
|
||||
<code class="sig-name descname">related_field</code><em class="property"> = None</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.related_field" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.extra">
|
||||
<code class="sig-name descname">extra</code><em class="property"> = 0</em><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.extra" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.get_formset">
|
||||
<code class="sig-name descname">get_formset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request</span></em>, <em class="sig-param"><span class="n">obj</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/web/admin/attributes.html#AttributeInline.get_formset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.get_formset" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>get_formset has to return a class, but we need to make the class that we return
|
||||
know about the related_field that we’ll use. Returning the class itself rather than
|
||||
a proxy isn’t threadsafe, since it’d be the base class and would change if multiple
|
||||
people used the admin at the same time</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.web.admin.attributes.AttributeInline.media">
|
||||
<em class="property">property </em><code class="sig-name descname">media</code><a class="headerlink" href="#evennia.web.admin.attributes.AttributeInline.media" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
|
@ -84,7 +228,6 @@
|
|||
<li><a href="../../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
|
|
@ -101,6 +244,7 @@
|
|||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">evennia.web.admin.attributes</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2020, The Evennia developer community.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue