aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorOscar Vilaplana2013-05-23 08:26:55 +0200
committerOscar Vilaplana2013-05-23 08:26:55 +0200
commita1deb5eac7d6d00c6269d88fce1cc6818d8ec04a (patch)
tree2be93e2cd91707f99e409211073ecced428a6d27 /rest_framework/serializers.py
parentdea0b6ab7fcf8eb9ffebbe7720e4923df7f3c5a4 (diff)
downloaddjango-rest-framework-a1deb5eac7d6d00c6269d88fce1cc6818d8ec04a.tar.bz2
simplified, moved field humanizing to Field. broken tests
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index 943fba6b..072815df 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -521,6 +521,13 @@ class BaseSerializer(WritableField):
return self.object
+ @property
+ def humanized(self):
+ humanized_fields = SortedDict(
+ [(name, field.humanized)
+ for name, field in self.fields.iteritems()])
+ return humanized_fields
+
class Serializer(six.with_metaclass(SerializerMetaclass, BaseSerializer)):
pass