From a00179b742a0b2b999ac7dbbbd880dc6c8c81058 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 18 Oct 2013 22:31:22 +0200 Subject: [PATCH] Fixed an error in aliasing --- src/objects/manager.py | 2 +- src/objects/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/objects/manager.py b/src/objects/manager.py index b0c9f3a29b..267f907301 100644 --- a/src/objects/manager.py +++ b/src/objects/manager.py @@ -207,7 +207,7 @@ class ObjectManager(TypedObjectManager): key_candidates = self.filter(cand_restriction & type_restriction) else: # fuzzy without supplied candidates - we select our own candidates - key_candidates = self.filter(type_restriction & (Q(db_key__istartswith=ostring) | Q(alias__db_key__istartswith=ostring))).distinct() + key_candidates = self.filter(type_restriction & (Q(db_key__istartswith=ostring) | Q(db_tags__db_key__istartswith=ostring))).distinct() candidates_id = [_GA(obj, "id") for obj in key_candidates] # fuzzy matching key_strings = key_candidates.values_list("db_key", flat=True) diff --git a/src/objects/models.py b/src/objects/models.py index 5529b622c1..e068661a24 100644 --- a/src/objects/models.py +++ b/src/objects/models.py @@ -141,8 +141,8 @@ class ObjectDB(TypedObject): _GA(self, "cmdset").update(init_mode=True) _SA(self, "scripts", ScriptHandler(self)) _SA(self, "attributes", AttributeHandler(self)) - _SA(self, "tags", TagHandler(self)) - _SA(self, "aliases", AliasHandler(self)) + _SA(self, "tags", TagHandler(self, category_prefix="object_")) + _SA(self, "aliases", AliasHandler(self, category_prefix="object_")) _SA(self, "nicks", NickHandler(self)) # make sure to sync the contents cache when initializing _GA(self, "contents_update")()