#24916: DjangoJSONEncoder: Decimal type localization mechanism is missing
-------------------------------------+-------------------------------------
Reporter: vartagg | Owner: nobody
Type: Bug | Status: closed
Component: Core | Version: 1.8
(Serialization) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by vartagg):
The JSON standard for serializing decimal values does not provide for
localized formatting. (See JSON.org.) This is why values are not
localized. I think it would also make the date less portable across
locales.
By following this, support of Decimals in DjangoJSONEncoder makes sense
only for web-applications that don't use localizations.
If you need localized values, then I'd suggest to create a custom encoder
for your serializer of choice which outputs the decimals appropriately.
Ok, but DjangoJSONEncoder has only one method: "default", what making it
hard to override. How about to divide it to different methods? It would be
very helpful.
--
Ticket URL: <https://code.djangoproject.com/ticket/24916#comment:2>
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/065.7bc3b12c3d333b286e45768d09e40236%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.