summaryrefslogtreecommitdiff
path: root/django/core/serializers/python.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2019-02-05 11:22:08 +0000
committerTim Graham <timograham@gmail.com>2019-02-06 13:48:39 -0500
commit24b82cd201e21060fbc02117dc16d1702877a1f3 (patch)
tree7d36db9251700d0abf8fbf69399c8abc7fd9026a /django/core/serializers/python.py
parent21bb71ef0dcb86798edb0d8b21138bcc4b947590 (diff)
downloaddjango-24b82cd201e21060fbc02117dc16d1702877a1f3.tar.gz
Fixed #30159 -- Removed unneeded use of OrderedDict.
Dicts preserve order since Python 3.6.
Diffstat (limited to 'django/core/serializers/python.py')
-rw-r--r--django/core/serializers/python.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py
index 08739c98fc..5a5d8a7036 100644
--- a/django/core/serializers/python.py
+++ b/django/core/serializers/python.py
@@ -3,7 +3,6 @@ A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
-from collections import OrderedDict
from django.apps import apps
from django.core.serializers import base
@@ -26,14 +25,14 @@ class Serializer(base.Serializer):
pass
def start_object(self, obj):
- self._current = OrderedDict()
+ self._current = {}
def end_object(self, obj):
self.objects.append(self.get_dump_object(obj))
self._current = None
def get_dump_object(self, obj):
- data = OrderedDict([('model', str(obj._meta))])
+ data = {'model': str(obj._meta)}
if not self.use_natural_primary_keys or not hasattr(obj, 'natural_key'):
data["pk"] = self._value_from_field(obj, obj._meta.pk)
data['fields'] = self._current