DecimalField and settings.USE_L10N #8869
Unanswered
cocorocho
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
According to documentation,
DecimalField
localizes value based on eitherlocalize
argument orsettings.USE_L10N
.So my
USE_L10N
is set toTrue
and myDecimalField(s)
are still not localized. Then I looked at the source code forDecimalField
and realized thatUSE_L10N
has no effect at all.django-rest-framework/rest_framework/fields.py
Lines 962 to 978 in 4abfa28
I would expect
django-rest-framework/rest_framework/fields.py
Line 978 in 4abfa28
to be
then it would work as documented.
Hence I forked in order to create a pull request, then I noticed that
USE_L10N
is going to be deprecated inDjango 5.0
.I haven't checked the previous commits, but is the current state intended due to upcoming deprecation of
USE_L10N
?If it is, we are currently on
Django 4.16
isn't it too soon, if it is not then the documentation is misleading?If none of the above, then I can gladly make a pull request if it is needed.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions