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,
DecimalFieldlocalizes value based on eitherlocalizeargument orsettings.USE_L10N.So my
USE_L10Nis set toTrueand myDecimalField(s)are still not localized. Then I looked at the source code forDecimalFieldand realized thatUSE_L10Nhas 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_L10Nis 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.16isn'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