aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorTom Christie2013-05-24 21:21:56 +0100
committerTom Christie2013-05-24 21:21:56 +0100
commit760e8642bd04b5e03409601a8d378799c36eac1b (patch)
tree69857f97ba5702fe040167a058fae0431abfe588 /rest_framework/serializers.py
parent78c53d530ff3d7a4a443b104ad73952d0b5b5b8b (diff)
parenta1deb5eac7d6d00c6269d88fce1cc6818d8ec04a (diff)
downloaddjango-rest-framework-760e8642bd04b5e03409601a8d378799c36eac1b.tar.bz2
Merge branch 'issue-192-expose-fields-for-options' of https://github.com/grimborg/django-rest-framework into improved-options-support
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 31f261e1..17da8c25 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