diff options
| author | Tom Christie | 2015-01-19 15:23:08 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-01-19 15:23:08 +0000 |
| commit | e5b94f7b7bbf2f6f35c5e33fb2723bdb0d33bad3 (patch) | |
| tree | a156a4a29a26540c52e5580ffa555b14d6c63fbe /rest_framework/relations.py | |
| parent | dbb684117f6fe0f9c34f98d5e914fc106090cdbc (diff) | |
| parent | 3cc39ffbceffc5fdbb511d9a10e7732329e8baa4 (diff) | |
| download | django-rest-framework-e5b94f7b7bbf2f6f35c5e33fb2723bdb0d33bad3.tar.bz2 | |
Merge branch 'version-3.1' into cursor-pagination
Diffstat (limited to 'rest_framework/relations.py')
| -rw-r--r-- | rest_framework/relations.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 05ac3d1c..a85edfec 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -7,6 +7,7 @@ from django.utils import six from django.utils.encoding import smart_text from django.utils.six.moves.urllib import parse as urlparse from django.utils.translation import ugettext_lazy as _ +from rest_framework.compat import OrderedDict from rest_framework.fields import get_attribute, empty, Field from rest_framework.reverse import reverse from rest_framework.utils import html @@ -103,7 +104,7 @@ class RelatedField(Field): @property def choices(self): - return dict([ + return OrderedDict([ ( six.text_type(self.to_representation(item)), six.text_type(item) @@ -364,7 +365,7 @@ class ManyRelatedField(Field): (item, self.child_relation.to_representation(item)) for item in iterable ] - return dict([ + return OrderedDict([ ( six.text_type(item_representation), six.text_type(item) + ' - ' + six.text_type(item_representation) |
