mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
Added to TypedObject's get() manager method, since without it, Q-objects didn't work correctly.
This commit is contained in:
parent
c7b26ff6a6
commit
f87d07b775
2 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue