From f87d07b775aa26ff6e55e36a162b8a823ee57daf Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 1 Dec 2015 12:24:09 +0100 Subject: [PATCH] Added to TypedObject's get() manager method, since without it, Q-objects didn't work correctly. --- evennia/typeclasses/managers.py | 5 ++++- evennia/utils/idmapper/manager.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/evennia/typeclasses/managers.py b/evennia/typeclasses/managers.py index 5a126f2dda..a622948d1c 100644 --- a/evennia/typeclasses/managers.py +++ b/evennia/typeclasses/managers.py @@ -507,11 +507,14 @@ class TypeclassManager(TypedObjectManager): """ - def get(self, **kwargs): + def get(self, *args, **kwargs): """ Overload the standard get. This will limit itself to only return the current typeclass. + Args: + args (any): These are passed on as arguments to the default + django get method. Kwargs: kwargs (any): These are passed on as normal arguments to the default django get method diff --git a/evennia/utils/idmapper/manager.py b/evennia/utils/idmapper/manager.py index 60f5d93a06..3b792f66eb 100644 --- a/evennia/utils/idmapper/manager.py +++ b/evennia/utils/idmapper/manager.py @@ -12,7 +12,7 @@ class SharedMemoryManager(Manager): # We need a way to handle reverse lookups so that this model can # still use the singleton cache, but the active model isn't required # to be a SharedMemoryModel. - def get(self, **kwargs): + def get(self, *args, **kwargs): """ Data entity lookup. """ @@ -26,5 +26,5 @@ class SharedMemoryManager(Manager): if key in ('pk', self.model._meta.pk.attname): inst = self.model.get_cached_instance(kwargs[items[0]]) if inst is None: - inst = super(SharedMemoryManager, self).get(**kwargs) + inst = super(SharedMemoryManager, self).get(*args, **kwargs) return inst