Add use_dbref kwarg for turning off #dbref lookup in obj.search. Resolves #990.

This commit is contained in:
Griatch 2016-08-19 22:14:51 +02:00
parent a3c2c1502e
commit d76b7b0454

View file

@ -276,10 +276,10 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
exact=False,
candidates=None,
nofound_string=None,
multimatch_string=None):
multimatch_string=None,
use_dbref=True):
"""
Returns the typeclass of an `Object` matching a search
string/condition
Returns an Object matching a search string/condition
Perform a standard object search in the database, handling
multiple results and lack thereof gracefully. By default, only
@ -328,6 +328,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
caller's contents (inventory).
nofound_string (str): optional custom string for not-found error message.
multimatch_string (str): optional custom string for multimatch error header.
use_dbref (bool, optional): if False, treat a given #dbref strings as a
normal string rather than database ids.
Returns:
match (Object, None or list): will return an Object/None if `quiet=False`,
@ -383,7 +385,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
attribute_name=attribute_name,
typeclass=typeclass,
candidates=candidates,
exact=exact)
exact=exact,
use_dbref=use_dbref)
if quiet:
return results
return _AT_SEARCH_RESULT(results, self, query=searchdata,