aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorOscar Vilaplana2013-05-19 15:08:41 +0200
committerOscar Vilaplana2013-05-19 15:08:41 +0200
commite80488b6192580c7a731114e58edd718d1c79120 (patch)
tree14be3eb1ca8cc3410ff0ba90835df3c6440cdd3f /rest_framework/fields.py
parentedbf65c06e403645d91ce9dec24495a58323a3a0 (diff)
downloaddjango-rest-framework-e80488b6192580c7a731114e58edd718d1c79120.tar.bz2
Added min_length and max_length
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 98768d72..cdcb0ee9 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -137,7 +137,8 @@ def humanize_field(field):
'type': humanize_field_type(field.__class__),
'required': getattr(field, 'required', False),
}
- optional_attrs = ['read_only', 'help_text', 'label']
+ optional_attrs = ['read_only', 'help_text', 'label',
+ 'min_length', 'max_length']
for attr in optional_attrs:
if getattr(field, attr, None) is not None:
humanized[attr] = getattr(field, attr)