#26459: Allow providing DecimalField with a custom context
-------------------------------------+-------------------------------------
Reporter: yasondinalt | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):
* has_patch: 1 => 0
* stage: Unreviewed => Accepted
* type: Bug => New feature
Comment:
Accepting per Aymeric's proposal on the mailing list:
Currently `DecimalField` accepts `max_digits` and `decimal_places`
options. I think it should accept a decimal context and delegate all
operations to that context.
I suggest the following behavior:
- start with the decimal context provided in a kwarg to `DecimalField` or,
if there is None, the current context returned by `getcontext()`.
- modify that context to take into account `max_digits` and
`decimal_places`
- ask the context to perform whatever operations we need
--
Ticket URL: <https://code.djangoproject.com/ticket/26459#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.9c602dd7f82ba435a6f769f22e58431d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.