aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-12-18 12:21:07 +0000
committerTom Christie2014-12-18 12:21:07 +0000
commitb8bdf812c14a287fda211810a72b53d4e671b6b2 (patch)
tree4f15cd5f9cbfcc033c2caabccbc89b17485ea7f3
parent1e531d20819442a739695df05edeb97f7ab5ef23 (diff)
parenta68d9331fcb0d461ee3dfd4e3e6cf9f0f6b7b988 (diff)
downloaddjango-rest-framework-b8bdf812c14a287fda211810a72b53d4e671b6b2.tar.bz2
Merge pull request #2315 from tomchristie/yaml-encoder-fix
YAML encoder fix for 3.0 serializers.
-rw-r--r--rest_framework/utils/encoders.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/rest_framework/utils/encoders.py b/rest_framework/utils/encoders.py
index adc83e57..73cbe5d8 100644
--- a/rest_framework/utils/encoders.py
+++ b/rest_framework/utils/encoders.py
@@ -7,6 +7,7 @@ from django.utils import six, timezone
from django.utils.encoding import force_text
from django.utils.functional import Promise
from rest_framework.compat import OrderedDict
+from rest_framework.utils.serializer_helpers import ReturnDict, ReturnList
import datetime
import decimal
import types
@@ -107,14 +108,14 @@ else:
OrderedDict,
yaml.representer.SafeRepresenter.represent_dict
)
- # SafeDumper.add_representer(
- # DictWithMetadata,
- # yaml.representer.SafeRepresenter.represent_dict
- # )
- # SafeDumper.add_representer(
- # OrderedDictWithMetadata,
- # yaml.representer.SafeRepresenter.represent_dict
- # )
+ SafeDumper.add_representer(
+ ReturnDict,
+ yaml.representer.SafeRepresenter.represent_dict
+ )
+ SafeDumper.add_representer(
+ ReturnList,
+ yaml.representer.SafeRepresenter.represent_list
+ )
SafeDumper.add_representer(
types.GeneratorType,
yaml.representer.SafeRepresenter.represent_list