style tweaks + changelog entry
This commit is contained in:
@@ -1263,11 +1263,10 @@ class BaseQuerySet(object):
|
||||
])
|
||||
if IS_PYMONGO_3:
|
||||
result = list(result)
|
||||
if result:
|
||||
return result[0]['total']
|
||||
else:
|
||||
if result['result']:
|
||||
return result['result'][0]['total']
|
||||
result = result.get('result')
|
||||
if result:
|
||||
return result[0]['total']
|
||||
return 0
|
||||
|
||||
def average(self, field):
|
||||
@@ -1340,11 +1339,10 @@ class BaseQuerySet(object):
|
||||
])
|
||||
if IS_PYMONGO_3:
|
||||
result = list(result)
|
||||
if result:
|
||||
return result[0]['total']
|
||||
else:
|
||||
if result['result']:
|
||||
return result['result'][0]['total']
|
||||
result = result.get('result')
|
||||
if result:
|
||||
return result[0]['total']
|
||||
return 0
|
||||
|
||||
def item_frequencies(self, field, normalize=False, map_reduce=True):
|
||||
|
||||
Reference in New Issue
Block a user