From e80488b6192580c7a731114e58edd718d1c79120 Mon Sep 17 00:00:00 2001 From: Oscar Vilaplana Date: Sun, 19 May 2013 15:08:41 +0200 Subject: [PATCH] Added min_length and max_length --- rest_framework/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 98768d721..cdcb0ee9e 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)