Fix DefaultObject.search. Resolve #2264.
This commit is contained in:
parent
d229ff024c
commit
d84ff8ff85
1 changed files with 7 additions and 3 deletions
|
|
@ -386,13 +386,16 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
|
||||||
searchdata (str or obj): Primary search criterion. Will be matched
|
searchdata (str or obj): Primary search criterion. Will be matched
|
||||||
against `object.key` (with `object.aliases` second) unless
|
against `object.key` (with `object.aliases` second) unless
|
||||||
the keyword attribute_name specifies otherwise.
|
the keyword attribute_name specifies otherwise.
|
||||||
**Special strings:**
|
|
||||||
|
Special strings:
|
||||||
|
|
||||||
- `#<num>`: search by unique dbref. This is always
|
- `#<num>`: search by unique dbref. This is always
|
||||||
a global search.
|
a global search.
|
||||||
- `me,self`: self-reference to this object
|
- `me,self`: self-reference to this object
|
||||||
- `<num>-<string>` - can be used to differentiate
|
- `<num>-<string>` - can be used to differentiate
|
||||||
between multiple same-named matches. The exact form of this input
|
between multiple same-named matches. The exact form of this input
|
||||||
is given by `settings.SEARCH_MULTIMATCH_REGEX`.
|
is given by `settings.SEARCH_MULTIMATCH_REGEX`.
|
||||||
|
|
||||||
global_search (bool): Search all objects globally. This overrules 'location' data.
|
global_search (bool): Search all objects globally. This overrules 'location' data.
|
||||||
use_nicks (bool): Use nickname-replace (nicktype "object") on `searchdata`.
|
use_nicks (bool): Use nickname-replace (nicktype "object") on `searchdata`.
|
||||||
typeclass (str or Typeclass, or list of either): Limit search only
|
typeclass (str or Typeclass, or list of either): Limit search only
|
||||||
|
|
@ -432,8 +435,9 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
|
||||||
otherwise.
|
otherwise.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
match (Object, None or list): will return an Object/None if `quiet=False`,
|
Object, None or list: Will return an `Object` or `None` if `quiet=False`. Will return a
|
||||||
otherwise it will return a list of 0, 1 or more matches.
|
list with 0, 1 or more matches if `quiet=True`. If `stacked` is a positive integer, this
|
||||||
|
list may contain all stacked identical matches.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
To find Accounts, use eg. `evennia.account_search`. If
|
To find Accounts, use eg. `evennia.account_search`. If
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue