mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 08:16:30 +01:00
Manager.py is returning a couple of querysets instead of lists. Fix for bug #2088
This commit is contained in:
parent
5745b6fda0
commit
d8d2ba4168
1 changed files with 4 additions and 4 deletions
|
|
@ -178,11 +178,11 @@ class ObjectDBManager(TypedObjectManager):
|
|||
# This doesn't work if attribute_value is an object. Workaround below
|
||||
|
||||
if isinstance(attribute_value, (str, int, float, bool)):
|
||||
return self.filter(
|
||||
return list(self.filter(
|
||||
cand_restriction
|
||||
& type_restriction
|
||||
& Q(db_attributes__db_key=attribute_name, db_attributes__db_value=attribute_value)
|
||||
).order_by("id")
|
||||
).order_by("id"))
|
||||
else:
|
||||
# We must loop for safety since the referenced lookup gives deepcopy error if attribute value is an object.
|
||||
global _ATTR
|
||||
|
|
@ -278,7 +278,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
exclude_restriction = (
|
||||
Q(pk__in=[_GA(obj, "id") for obj in make_iter(excludeobj)]) if excludeobj else Q()
|
||||
)
|
||||
return self.filter(db_location=location).exclude(exclude_restriction).order_by("id")
|
||||
return list(self.filter(db_location=location).exclude(exclude_restriction).order_by("id"))
|
||||
|
||||
def get_objs_with_key_or_alias(self, ostring, exact=True, candidates=None, typeclasses=None):
|
||||
"""
|
||||
|
|
@ -309,7 +309,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
type_restriction = typeclasses and Q(db_typeclass_path__in=make_iter(typeclasses)) or Q()
|
||||
if exact:
|
||||
# exact match - do direct search
|
||||
return (
|
||||
return list(
|
||||
(
|
||||
self.filter(
|
||||
cand_restriction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue