mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 05:57:16 +02:00
Changed how Objects are searched, using proper Django Q objects instead of hack-y evals to build queries. This has lead to a number of changes to the ObjectDB manager search. Notably there is now no way to supply a "location" to either of the manager search methods anymore. Instead you can now supply the keyword "candidates", a list of objects which should be used to limit the search. This is much more generic than giving location. The higher-level search (like caller.search, reached from commands) have not changed its API, so commands should work the same unless you are using the manager backbone directly. This search function is now using location to create the "candidates" list. Some other things, like matching for "me" and "here" have also been moved up to a level were it can be easily overloaded. "me" and "here" etc were also moved under i18n.
As part of this overhaul I implemented the partial_matching algorithm originally asked for by user "Adam_ASE" over IRC. This will allow for (local-only) partial matching of objects. So "big black sword" will now be matched by "bi", "sword", "bi bla" and so on. The partial matcher sits in src.utils.utils.py if one wants to use it for something else.
This commit is contained in:
parent
cc6fa079b6
commit
c53a9b5770
7 changed files with 236 additions and 193 deletions
|
|
@ -42,7 +42,6 @@ class ScriptManager(TypedObjectManager):
|
|||
if not obj:
|
||||
return []
|
||||
if key:
|
||||
script = []
|
||||
dbref = self.dbref(key)
|
||||
if dbref:
|
||||
script = self.filter(db_obj=obj, id=dbref)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue