Add a Decimal type and a Currency type
|Reported by:||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:|
|Cc:||moof@…, adurdin@…, gary.wilson@…, rushman@…||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Add a DecimalField type that maps between python's Decimal type and mySQL's and PostgreSQL's NUMERIC type. I can't make head nor tail of SQLite's type system, but I assume it has some analogue. It should be possible to define the precision and scale of these types, but they should be optional.
Add a CurrencyField type which is analogous to a DecimalField limited to two decimal places.
Floating point numbers are not good for currency amounts, and I tire of having to convert between an integer number of cents and a string which is in Euro.