aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils
diff options
context:
space:
mode:
authorTom Christie2014-10-31 16:38:39 +0000
committerTom Christie2014-10-31 16:38:39 +0000
commit207208fedff2457e921ef7d825ea7c3933b5dd6e (patch)
tree82ef4afacbc78d7af6f13fb73342794a1102415f /rest_framework/utils
parent11075d37709d1ee41f14361cb521ff8d1aa0cc1d (diff)
downloaddjango-rest-framework-207208fedff2457e921ef7d825ea7c3933b5dd6e.tar.bz2
Lazy loading of fields and validators. Closes #1963.
Diffstat (limited to 'rest_framework/utils')
-rw-r--r--rest_framework/utils/representation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/utils/representation.py b/rest_framework/utils/representation.py
index 180b51f8..2a7c4675 100644
--- a/rest_framework/utils/representation.py
+++ b/rest_framework/utils/representation.py
@@ -82,6 +82,11 @@ def serializer_repr(serializer, indent, force_many=None):
ret += field_repr(field.child_relation, force_many=field.child_relation)
else:
ret += field_repr(field)
+
+ if serializer.validators:
+ ret += '\n' + indent_str + 'class Meta:'
+ ret += '\n' + indent_str + ' validators = ' + smart_repr(serializer.validators)
+
return ret