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

474 lines
No EOL
33 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>evennia.objects.manager &#8212; Evennia 0.9.5 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.objects.manager</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-evennia.objects.manager">
<span id="evennia-objects-manager"></span><h1>evennia.objects.manager<a class="headerlink" href="#module-evennia.objects.manager" title="Permalink to this headline"></a></h1>
<p>Custom manager for Objects.</p>
<dl class="py class">
<dt id="evennia.objects.manager.ObjectManager">
<em class="property">class </em><code class="sig-prename descclassname">evennia.objects.manager.</code><code class="sig-name descname">ObjectManager</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/objects/manager.html#ObjectManager"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.objects.manager.ObjectDBManager" title="evennia.objects.manager.ObjectDBManager"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.manager.ObjectDBManager</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.typeclasses.managers.TypeclassManager</span></code></p>
</dd></dl>
<dl class="py class">
<dt id="evennia.objects.manager.ObjectDBManager">
<em class="property">class </em><code class="sig-prename descclassname">evennia.objects.manager.</code><code class="sig-name descname">ObjectDBManager</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/objects/manager.html#ObjectDBManager"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="evennia.typeclasses.managers.html#evennia.typeclasses.managers.TypedObjectManager" title="evennia.typeclasses.managers.TypedObjectManager"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.typeclasses.managers.TypedObjectManager</span></code></a></p>
<p>This ObjectManager implements methods for searching
and manipulating Objects directly from the database.</p>
<p>Evennia-specific search methods (will return Typeclasses or
lists of Typeclasses, whereas Django-general methods will return
Querysets or database objects).</p>
<p>dbref (converter)
get_id (alias: dbref_search)
get_dbref_range
object_totals
typeclass_search
get_object_with_account
get_objs_with_key_and_typeclass
get_objs_with_attr
get_objs_with_attr_match
get_objs_with_db_property
get_objs_with_db_property_match
get_objs_with_key_or_alias
get_contents
object_search (interface to many of the above methods,</p>
<blockquote>
<div><p>equivalent to evennia.search_object)</p>
</div></blockquote>
<p>copy_object</p>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_object_with_account">
<code class="sig-name descname">get_object_with_account</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ostring</span></em>, <em class="sig-param"><span class="n">exact</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_object_with_account"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_object_with_account" title="Permalink to this definition"></a></dt>
<dd><p>Search for an object based on its accounts name or dbref.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ostring</strong> (<em>str</em><em> or </em><em>int</em>) Search criterion or dbref. Searching
for an account is sometimes initiated by appending an <strong>*</strong> to
the beginning of the search criterion (e.g. in
local_and_global_search). This is stripped here.</p></li>
<li><p><strong>exact</strong> (<em>bool</em><em>, </em><em>optional</em>) Require an exact account match.</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) Only search among this list of possible
object candidates.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>match (query)</em> Matching query.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_key_and_typeclass">
<code class="sig-name descname">get_objs_with_key_and_typeclass</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">oname</span></em>, <em class="sig-param"><span class="n">otypeclass_path</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_key_and_typeclass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_key_and_typeclass" title="Permalink to this definition"></a></dt>
<dd><p>Returns objects based on simultaneous key and typeclass match.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>oname</strong> (<em>str</em>) Object key to search for</p></li>
<li><p><strong>otypeclass_path</strong> (<em>str</em>) Full Python path to tyepclass to search for</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) Only match among the given list of candidates.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (query)</em> The matching objects.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_attr">
<code class="sig-name descname">get_objs_with_attr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">attribute_name</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_attr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_attr" title="Permalink to this definition"></a></dt>
<dd><p>Get objects based on having a certain Attribute defined.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attribute_name</strong> (<em>str</em>) Attribute name to search for.</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) Only match among the given list of object
candidates.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (query)</em> All objects having the given attribute_name defined at all.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_attr_value">
<code class="sig-name descname">get_objs_with_attr_value</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">attribute_name</span></em>, <em class="sig-param"><span class="n">attribute_value</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclasses</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_attr_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_attr_value" title="Permalink to this definition"></a></dt>
<dd><p>Get all objects having the given attrname set to the given value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attribute_name</strong> (<em>str</em>) Attribute key to search for.</p></li>
<li><p><strong>attribute_value</strong> (<em>any</em>) Attribute value to search for. This can also be database objects.</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) Candidate objects to limit search to.</p></li>
<li><p><strong>typeclasses</strong> (<em>list</em><em>, </em><em>optional</em>) Python pats to restrict matches with.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (query)</em> Objects fullfilling both the <strong>attribute_name</strong> and
<strong>attribute_value</strong> criterions.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>This uses the Attributes PickledField to transparently search the database by matching
the internal representation. This is reasonably effective but since Attribute values
cannot be indexed, searching by Attribute key is to be preferred whenever possible.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_db_property">
<code class="sig-name descname">get_objs_with_db_property</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">property_name</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_db_property"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_db_property" title="Permalink to this definition"></a></dt>
<dd><p>Get all objects having a given db field property.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>property_name</strong> (<em>str</em>) The name of the field to match for.</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) Only search among th egiven candidates.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (list)</em> The found matches.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_db_property_value">
<code class="sig-name descname">get_objs_with_db_property_value</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">property_name</span></em>, <em class="sig-param"><span class="n">property_value</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclasses</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_db_property_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_db_property_value" title="Permalink to this definition"></a></dt>
<dd><p>Get objects with a specific field name and value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>property_name</strong> (<em>str</em>) Field name to search for.</p></li>
<li><p><strong>property_value</strong> (<em>any</em>) Value required for field with <strong>property_name</strong> to have.</p></li>
<li><p><strong>candidates</strong> (<em>list</em><em>, </em><em>optional</em>) List of objects to limit search to.</p></li>
<li><p><strong>typeclasses</strong> (<em>list</em><em>, </em><em>optional</em>) List of typeclass-path strings to restrict matches with</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_contents">
<code class="sig-name descname">get_contents</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">location</span></em>, <em class="sig-param"><span class="n">excludeobj</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_contents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_contents" title="Permalink to this definition"></a></dt>
<dd><p>Get all objects that has a location set to this one.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>location</strong> (<em>Object</em>) Where to get contents from.</p></li>
<li><p><strong>excludeobj</strong> (<em>Object</em><em> or </em><em>list</em><em>, </em><em>optional</em>) One or more objects
to exclude from the match.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>contents (query)</em> Matching contents, without excludeobj, if given.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.get_objs_with_key_or_alias">
<code class="sig-name descname">get_objs_with_key_or_alias</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ostring</span></em>, <em class="sig-param"><span class="n">exact</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclasses</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.get_objs_with_key_or_alias"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.get_objs_with_key_or_alias" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ostring</strong> (<em>str</em>) A search criterion.</p></li>
<li><p><strong>exact</strong> (<em>bool</em><em>, </em><em>optional</em>) Require exact match of ostring
(still case-insensitive). If <strong>False</strong>, will do fuzzy matching
using <strong>evennia.utils.utils.string_partial_matching</strong> algorithm.</p></li>
<li><p><strong>candidates</strong> (<em>list</em>) Only match among these candidates.</p></li>
<li><p><strong>typeclasses</strong> (<em>list</em>) Only match objects with typeclasses having thess path strings.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (query)</em> A list of matches of length 0, 1 or more.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.search_object">
<code class="sig-name descname">search_object</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">searchdata</span></em>, <em class="sig-param"><span class="n">attribute_name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclass</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">exact</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_dbref</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.search_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.search_object" title="Permalink to this definition"></a></dt>
<dd><p>Search as an object globally or in a list of candidates and
return results. The result is always an Object. Always returns
a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searchdata</strong> (<em>str</em><em> or </em><em>Object</em>) The entity to match for. This is
usually a key string but may also be an object itself.
By default (if no <strong>attribute_name</strong> is set), this will
search <strong>object.key</strong> and <strong>object.aliases</strong> in order.
Can also be on the form #dbref, which will (if
<strong>exact=True</strong>) be matched against primary key.</p></li>
<li><p><strong>attribute_name</strong> (<em>str</em>) Use this named Attribute to
match searchdata against, instead of the defaults. If
this is the name of a database field (with or without
the <strong>db_</strong> prefix), that will be matched too.</p></li>
<li><p><strong>typeclass</strong> (<em>str</em><em> or </em><em>TypeClass</em>) restrict matches to objects
having this typeclass. This will help speed up global
searches.</p></li>
<li><p><strong>candidates</strong> (<em>list</em>) If supplied, search will
only be performed among the candidates in this list. A
common list of candidates is the contents of the
current location searched.</p></li>
<li><p><strong>exact</strong> (<em>bool</em>) Match names/aliases exactly or partially.
Partial matching matches the beginning of words in the
names/aliases, using a matching routine to separate
multiple matches in names with multiple components (so
“bi sw” will match “Big sword”). Since this is more
expensive than exact matching, it is recommended to be
used together with the <strong>candidates</strong> keyword to limit the
number of possibilities. This value has no meaning if
searching for attributes/properties.</p></li>
<li><p><strong>use_dbref</strong> (<em>bool</em>) If False, bypass direct lookup of a string
on the form #dbref and treat it like any string.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (list)</em> Matching objects</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.object_search">
<code class="sig-name descname">object_search</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">searchdata</span></em>, <em class="sig-param"><span class="n">attribute_name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclass</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">exact</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_dbref</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.object_search" title="Permalink to this definition"></a></dt>
<dd><p>Search as an object globally or in a list of candidates and
return results. The result is always an Object. Always returns
a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searchdata</strong> (<em>str</em><em> or </em><em>Object</em>) The entity to match for. This is
usually a key string but may also be an object itself.
By default (if no <strong>attribute_name</strong> is set), this will
search <strong>object.key</strong> and <strong>object.aliases</strong> in order.
Can also be on the form #dbref, which will (if
<strong>exact=True</strong>) be matched against primary key.</p></li>
<li><p><strong>attribute_name</strong> (<em>str</em>) Use this named Attribute to
match searchdata against, instead of the defaults. If
this is the name of a database field (with or without
the <strong>db_</strong> prefix), that will be matched too.</p></li>
<li><p><strong>typeclass</strong> (<em>str</em><em> or </em><em>TypeClass</em>) restrict matches to objects
having this typeclass. This will help speed up global
searches.</p></li>
<li><p><strong>candidates</strong> (<em>list</em>) If supplied, search will
only be performed among the candidates in this list. A
common list of candidates is the contents of the
current location searched.</p></li>
<li><p><strong>exact</strong> (<em>bool</em>) Match names/aliases exactly or partially.
Partial matching matches the beginning of words in the
names/aliases, using a matching routine to separate
multiple matches in names with multiple components (so
“bi sw” will match “Big sword”). Since this is more
expensive than exact matching, it is recommended to be
used together with the <strong>candidates</strong> keyword to limit the
number of possibilities. This value has no meaning if
searching for attributes/properties.</p></li>
<li><p><strong>use_dbref</strong> (<em>bool</em>) If False, bypass direct lookup of a string
on the form #dbref and treat it like any string.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (list)</em> Matching objects</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.search">
<code class="sig-name descname">search</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">searchdata</span></em>, <em class="sig-param"><span class="n">attribute_name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">typeclass</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">candidates</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">exact</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">use_dbref</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.search" title="Permalink to this definition"></a></dt>
<dd><p>Search as an object globally or in a list of candidates and
return results. The result is always an Object. Always returns
a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searchdata</strong> (<em>str</em><em> or </em><em>Object</em>) The entity to match for. This is
usually a key string but may also be an object itself.
By default (if no <strong>attribute_name</strong> is set), this will
search <strong>object.key</strong> and <strong>object.aliases</strong> in order.
Can also be on the form #dbref, which will (if
<strong>exact=True</strong>) be matched against primary key.</p></li>
<li><p><strong>attribute_name</strong> (<em>str</em>) Use this named Attribute to
match searchdata against, instead of the defaults. If
this is the name of a database field (with or without
the <strong>db_</strong> prefix), that will be matched too.</p></li>
<li><p><strong>typeclass</strong> (<em>str</em><em> or </em><em>TypeClass</em>) restrict matches to objects
having this typeclass. This will help speed up global
searches.</p></li>
<li><p><strong>candidates</strong> (<em>list</em>) If supplied, search will
only be performed among the candidates in this list. A
common list of candidates is the contents of the
current location searched.</p></li>
<li><p><strong>exact</strong> (<em>bool</em>) Match names/aliases exactly or partially.
Partial matching matches the beginning of words in the
names/aliases, using a matching routine to separate
multiple matches in names with multiple components (so
“bi sw” will match “Big sword”). Since this is more
expensive than exact matching, it is recommended to be
used together with the <strong>candidates</strong> keyword to limit the
number of possibilities. This value has no meaning if
searching for attributes/properties.</p></li>
<li><p><strong>use_dbref</strong> (<em>bool</em>) If False, bypass direct lookup of a string
on the form #dbref and treat it like any string.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>matches (list)</em> Matching objects</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.copy_object">
<code class="sig-name descname">copy_object</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">original_object</span></em>, <em class="sig-param"><span class="n">new_key</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_location</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_home</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_permissions</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_locks</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_aliases</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">new_destination</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.copy_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.copy_object" title="Permalink to this definition"></a></dt>
<dd><p>Create and return a new object as a copy of the original object. All
will be identical to the original except for the arguments given
specifically to this method. Object contents will not be copied.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>original_object</strong> (<em>Object</em>) The object to make a copy from.</p></li>
<li><p><strong>new_key</strong> (<em>str</em><em>, </em><em>optional</em>) Name of the copy, if different
from the original.</p></li>
<li><p><strong>new_location</strong> (<em>Object</em><em>, </em><em>optional</em>) Alternate location.</p></li>
<li><p><strong>new_home</strong> (<em>Object</em><em>, </em><em>optional</em>) Change the home location</p></li>
<li><p><strong>new_aliases</strong> (<em>list</em><em>, </em><em>optional</em>) Give alternate object
aliases as a list of strings.</p></li>
<li><p><strong>new_destination</strong> (<em>Object</em><em>, </em><em>optional</em>) Used only by exits.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><p><em>copy (Object or None)</em> </p>
<dl class="simple">
<dt>The copy of <strong>original_object</strong>,</dt><dd><p>optionally modified as per the ingoing keyword
arguments. <strong>None</strong> if an error was encountered.</p>
</dd>
</dl>
</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.objects.manager.ObjectDBManager.clear_all_sessids">
<code class="sig-name descname">clear_all_sessids</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/objects/manager.html#ObjectDBManager.clear_all_sessids"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.objects.manager.ObjectDBManager.clear_all_sessids" title="Permalink to this definition"></a></dt>
<dd><p>Clear the db_sessid field of all objects having also the
db_account field set.</p>
</dd></dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/api/evennia.objects.manager.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li><a href="http://webchat.freenode.net/?channels=evennia&uio=MT1mYWxzZSY5PXRydWUmMTE9MTk1JjEyPXRydWUbb">IRC</a> -
<a href="https://discord.gg/NecFePw">Discord</a> -
<a href="https://groups.google.com/forum/#%21forum/evennia">Forums</a>
</li>
<li><a href="http://evennia.blogspot.com/">Evennia Dev blog</a> </li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="../../1.0-dev/api/evennia.objects.manager.html">1.0-dev (develop branch)</a></li>
<li><a href="evennia.objects.manager.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">evennia.objects.manager</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>