DecimalField does not correctly set default value
|Reported by:||Moof||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
DecimalField's default argument appears to set the field to a unicode rather than a Decimal instance, this then makes calculations involving Decimals not work.
I've attached a small models.py file that can be used to check the behaviour, including expected results and the actual ones.
There's a smallish bug that Decimal("0.00") doesn't retain its precision on loading, but this may be a python bug.
Change History (5)
comment:1 Changed 8 years ago by Moof
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset