Making the query actually get called for get
This commit is contained in:
parent
c38faebc25
commit
47e4dd40cd
@ -295,11 +295,12 @@ class QuerySet(object):
|
|||||||
|
|
||||||
return mongo_query
|
return mongo_query
|
||||||
|
|
||||||
def get(self):
|
def get(self, *q_objs, **query):
|
||||||
"""Retrieve the the matching object raising
|
"""Retrieve the the matching object raising
|
||||||
'MultipleObjectsReturned' or 'DoesNotExist' exceptions
|
'MultipleObjectsReturned' or 'DoesNotExist' exceptions
|
||||||
if multiple or no results are found.
|
if multiple or no results are found.
|
||||||
"""
|
"""
|
||||||
|
self.__call__(*q_objs, **query)
|
||||||
count = self.count()
|
count = self.count()
|
||||||
if count == 1:
|
if count == 1:
|
||||||
return self[0]
|
return self[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user