Added rounding for unicode return value of to_mongo in DecimalField. Closes #1103
This commit is contained in:
parent
25e0f12976
commit
7ce8768c19
1
AUTHORS
1
AUTHORS
@ -242,3 +242,4 @@ that much better:
|
|||||||
* xiaost7 (https://github.com/xiaost7)
|
* xiaost7 (https://github.com/xiaost7)
|
||||||
* Victor Varvaryuk
|
* Victor Varvaryuk
|
||||||
* Stanislav Kaledin (https://github.com/sallyruthstruik)
|
* Stanislav Kaledin (https://github.com/sallyruthstruik)
|
||||||
|
* Dmitry Yantsen (https://github.com/mrTable)
|
||||||
|
@ -7,6 +7,7 @@ Changes in 0.10.8
|
|||||||
- Added ability to specify an authentication mechanism (e.g. X.509) #1333
|
- Added ability to specify an authentication mechanism (e.g. X.509) #1333
|
||||||
- Added support for falsey primary keys (e.g. doc.pk = 0) #1354
|
- Added support for falsey primary keys (e.g. doc.pk = 0) #1354
|
||||||
- Fixed BaseQuerySet#sum/average for fields w/ explicit db_field #1417
|
- Fixed BaseQuerySet#sum/average for fields w/ explicit db_field #1417
|
||||||
|
- Fixed absent rounding for DecimalField when `force_string` is set. #1103
|
||||||
|
|
||||||
Changes in 0.10.7
|
Changes in 0.10.7
|
||||||
=================
|
=================
|
||||||
|
@ -341,7 +341,7 @@ class DecimalField(BaseField):
|
|||||||
if value is None:
|
if value is None:
|
||||||
return value
|
return value
|
||||||
if self.force_string:
|
if self.force_string:
|
||||||
return unicode(value)
|
return unicode(self.to_python(value))
|
||||||
return float(self.to_python(value))
|
return float(self.to_python(value))
|
||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user