<spanid="evennia-utils-create"></span><h1>evennia.utils.create<aclass="headerlink"href="#module-evennia.utils.create"title="Link to this heading">¶</a></h1>
<p>This module gathers all the essential database-creation functions for the game
engine’s various object types.</p>
<p>Only objects created ‘stand-alone’ are in here. E.g. object Attributes are
always created through their respective objects handlers.</p>
<p>Each <strong>creation_*</strong> function also has an alias named for the entity being created,
such as create_object() and object(). This is for consistency with the
utils.search module and allows you to do the shorter <strong>create.object()</strong>.</p>
<p>The respective object managers hold more methods for manipulating and searching
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_object</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_object"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_object"title="Link to this definition">¶</a></dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.accounts.accounts.html#evennia.accounts.accounts.ObjectDB.DoesNotExist"title="evennia.accounts.accounts.ObjectDB.DoesNotExist"><strong>ObjectDB.DoesNotExist</strong></a>– If trying to create an Object with
<strong>location</strong> or <strong>home</strong> that can’t be found.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_script</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_script"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_script"title="Link to this definition">¶</a></dt>
<dd><p>Create a new script. All scripts are a combination of a database
object that communicates with the database, and an typeclass that
‘decorates’ the database object into being different types of
scripts. It’s behaviour is similar to the game objects except
scripts has a time component and are more limited in scope.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_help_entry</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_help_entry"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_help_entry"title="Link to this definition">¶</a></dt>
<dd><p>Create a static help entry in the help database. Note that Command
help entries are dynamic and directly taken from the __doc__
entries of the command. The database-stored help entries are
intended for more general help on the game, more extensive info,
<li><p><strong>key</strong> (<em>str</em>) – The name of the help entry.</p></li>
<li><p><strong>entrytext</strong> (<em>str</em>) – The body of te help entry</p></li>
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The help category of the entry.</p></li>
<li><p><strong>locks</strong> (<em>str</em><em>, </em><em>optional</em>) – A lockstring to restrict access.</p></li>
<li><p><strong>aliases</strong> (<em>list</em><em> of </em><em>str</em><em>, </em><em>optional</em>) – List of alternative (likely shorter) keynames.</p></li>
<li><p><strong>tags</strong> (<em>lst</em><em>, </em><em>optional</em>) – List of tags or tuples <strong>(tag, category)</strong>.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_message</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_message"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_message"title="Link to this definition">¶</a></dt>
<dd><p>Create a new communication Msg. Msgs represent a unit of
database-persistent communication between entites.</p>
<li><p><strong>senderobj</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>Script</em><em>, </em><em>str</em><em> or </em><em>list</em>) – The entity (or
entities) sending the Msg. If a <strong>str</strong>, this is the id-string
for an external sender type.</p></li>
<li><p><strong>message</strong> (<em>str</em>) – Text with the message. Eventual headers, titles
etc should all be included in this text string. Formatting
will be retained.</p></li>
<li><p><strong>receivers</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>Script</em><em>, </em><em>str</em><em> or </em><em>list</em>) – An Account/Object to send
to, or a list of them. If a string, it’s an identifier for an external
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_channel</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_channel"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_channel"title="Link to this definition">¶</a></dt>
<dd><p>Create A communication Channel. A Channel serves as a central hub
for distributing Msgs to groups of people without specifying the
receivers explicitly. Instead accounts may ‘connect’ to the channel
and follow the flow of messages. By default the channel allows
access to all old messages, but this can be turned off with the
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">create_account</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/create.html#create_account"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.create_account"title="Link to this definition">¶</a></dt>
<li><p><strong>key</strong> (<em>str</em>) – The account’s name. This should be unique.</p></li>
<li><p><strong>email</strong> (<em>str</em><em> or </em><em>None</em>) – Email on valid <aclass="reference external"href="mailto:addr%40addr.domain">addr<span>@</span>addr<span>.</span>domain</a> form. If
the empty string, will be set to None.</p></li>
<li><p><strong>password</strong> (<em>str</em>) – Password in cleartext.</p></li>
<emclass="property"><spanclass="k"><spanclass="pre">class</span></span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">SimpleLazyObject</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">func</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/django/utils/functional.html#SimpleLazyObject"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.SimpleLazyObject"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">__init__</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">func</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/django/utils/functional.html#SimpleLazyObject.__init__"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#evennia.utils.create.SimpleLazyObject.__init__"title="Link to this definition">¶</a></dt>
<dd><p>Pass in a callable that returns the object to be wrapped.</p>
<p>If copies are made of the resulting SimpleLazyObject, which can happen
in various circumstances within Django, then you must ensure that the
callable can be safely run more than once and will return the same
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">account</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.account"title="Link to this definition">¶</a></dt>
<li><p><strong>key</strong> (<em>str</em>) – The account’s name. This should be unique.</p></li>
<li><p><strong>email</strong> (<em>str</em><em> or </em><em>None</em>) – Email on valid <aclass="reference external"href="mailto:addr%40addr.domain">addr<span>@</span>addr<span>.</span>domain</a> form. If
the empty string, will be set to None.</p></li>
<li><p><strong>password</strong> (<em>str</em>) – Password in cleartext.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">channel</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.channel"title="Link to this definition">¶</a></dt>
<dd><p>Create A communication Channel. A Channel serves as a central hub
for distributing Msgs to groups of people without specifying the
receivers explicitly. Instead accounts may ‘connect’ to the channel
and follow the flow of messages. By default the channel allows
access to all old messages, but this can be turned off with the
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">help_entry</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.help_entry"title="Link to this definition">¶</a></dt>
<dd><p>Create a static help entry in the help database. Note that Command
help entries are dynamic and directly taken from the __doc__
entries of the command. The database-stored help entries are
intended for more general help on the game, more extensive info,
<li><p><strong>key</strong> (<em>str</em>) – The name of the help entry.</p></li>
<li><p><strong>entrytext</strong> (<em>str</em>) – The body of te help entry</p></li>
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The help category of the entry.</p></li>
<li><p><strong>locks</strong> (<em>str</em><em>, </em><em>optional</em>) – A lockstring to restrict access.</p></li>
<li><p><strong>aliases</strong> (<em>list</em><em> of </em><em>str</em><em>, </em><em>optional</em>) – List of alternative (likely shorter) keynames.</p></li>
<li><p><strong>tags</strong> (<em>lst</em><em>, </em><em>optional</em>) – List of tags or tuples <strong>(tag, category)</strong>.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">message</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.message"title="Link to this definition">¶</a></dt>
<dd><p>Create a new communication Msg. Msgs represent a unit of
database-persistent communication between entites.</p>
<li><p><strong>senderobj</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>Script</em><em>, </em><em>str</em><em> or </em><em>list</em>) – The entity (or
entities) sending the Msg. If a <strong>str</strong>, this is the id-string
for an external sender type.</p></li>
<li><p><strong>message</strong> (<em>str</em>) – Text with the message. Eventual headers, titles
etc should all be included in this text string. Formatting
will be retained.</p></li>
<li><p><strong>receivers</strong> (<em>Object</em><em>, </em><em>Account</em><em>, </em><em>Script</em><em>, </em><em>str</em><em> or </em><em>list</em>) – An Account/Object to send
to, or a list of them. If a string, it’s an identifier for an external
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">object</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.object"title="Link to this definition">¶</a></dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.accounts.accounts.html#evennia.accounts.accounts.ObjectDB.DoesNotExist"title="evennia.accounts.accounts.ObjectDB.DoesNotExist"><strong>ObjectDB.DoesNotExist</strong></a>– If trying to create an Object with
<strong>location</strong> or <strong>home</strong> that can’t be found.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">evennia.utils.create.</span></span><spanclass="sig-name descname"><spanclass="pre">script</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span><spanclass="n"><spanclass="pre">args</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#evennia.utils.create.script"title="Link to this definition">¶</a></dt>
<dd><p>Create a new script. All scripts are a combination of a database
object that communicates with the database, and an typeclass that
‘decorates’ the database object into being different types of
scripts. It’s behaviour is similar to the game objects except
scripts has a time component and are more limited in scope.</p>