style tweaks + changelog entry
This commit is contained in:
parent
1233780265
commit
b7ef82cb67
@ -25,6 +25,7 @@ Changes in 0.9.X - DEV
|
|||||||
- Updated URL and Email Field regex validators, added schemes argument to URLField validation. #652
|
- Updated URL and Email Field regex validators, added schemes argument to URLField validation. #652
|
||||||
- Removed get_or_create() deprecated since 0.8.0. #300
|
- Removed get_or_create() deprecated since 0.8.0. #300
|
||||||
- Capped collection multiple of 256. #1011
|
- Capped collection multiple of 256. #1011
|
||||||
|
- Added `BaseQuerySet.aggregate_sum` and `BaseQuerySet.aggregate_average` methods.
|
||||||
|
|
||||||
Changes in 0.9.0
|
Changes in 0.9.0
|
||||||
================
|
================
|
||||||
|
@ -1263,11 +1263,10 @@ class BaseQuerySet(object):
|
|||||||
])
|
])
|
||||||
if IS_PYMONGO_3:
|
if IS_PYMONGO_3:
|
||||||
result = list(result)
|
result = list(result)
|
||||||
if result:
|
|
||||||
return result[0]['total']
|
|
||||||
else:
|
else:
|
||||||
if result['result']:
|
result = result.get('result')
|
||||||
return result['result'][0]['total']
|
if result:
|
||||||
|
return result[0]['total']
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def average(self, field):
|
def average(self, field):
|
||||||
@ -1340,11 +1339,10 @@ class BaseQuerySet(object):
|
|||||||
])
|
])
|
||||||
if IS_PYMONGO_3:
|
if IS_PYMONGO_3:
|
||||||
result = list(result)
|
result = list(result)
|
||||||
if result:
|
|
||||||
return result[0]['total']
|
|
||||||
else:
|
else:
|
||||||
if result['result']:
|
result = result.get('result')
|
||||||
return result['result'][0]['total']
|
if result:
|
||||||
|
return result[0]['total']
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def item_frequencies(self, field, normalize=False, map_reduce=True):
|
def item_frequencies(self, field, normalize=False, map_reduce=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user