Added to TypedObject's get() manager method, since without it, Q-objects didn't work correctly.

This commit is contained in:
Griatch 2015-12-01 12:24:09 +01:00
parent c7b26ff6a6
commit f87d07b775
2 changed files with 6 additions and 3 deletions

View file

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

View file

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