Fixed an error in aliasing

This commit is contained in:
Griatch 2013-10-18 22:31:22 +02:00
parent 584d1095ad
commit a00179b742
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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")()