Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tweaked changes from r17228 to cater for older simplejson versions.

dump() started accepting the `use_decimal` argument in 2.1.3.

Refs #16850.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17229 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5003df3659f8f6d32f60bab8c409a1159cc956a1 1 parent b5d9ad9
Ramiro Morales authored

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  django/core/serializers/json.py
4  django/core/serializers/json.py
@@ -18,7 +18,9 @@ class Serializer(PythonSerializer):
18 18
     internal_use_only = False
19 19
 
20 20
     def end_serialization(self):
21  
-        self.options.update({'use_decimal': False}) # Use JS strings to represent Python Decimal instances (ticket #16850)
  21
+        if simplejson.__version__.split('.') >= ['2', '1', '3']:
  22
+            # Use JS strings to represent Python Decimal instances (ticket #16850)
  23
+            self.options.update({'use_decimal': False})
22 24
         simplejson.dump(self.objects, self.stream, cls=DjangoJSONEncoder, **self.options)
23 25
 
24 26
     def getvalue(self):

0 notes on commit 5003df3

Please sign in to comment.
Something went wrong with that request. Please try again.