From 24b82cd201e21060fbc02117dc16d1702877a1f3 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Tue, 5 Feb 2019 11:22:08 +0000 Subject: Fixed #30159 -- Removed unneeded use of OrderedDict. Dicts preserve order since Python 3.6. --- django/core/serializers/python.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'django/core/serializers/python.py') 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 -- cgit v1.3