mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-27 00:40:40 +03:00
Added min_length and max_length
This commit is contained in:
parent
edbf65c06e
commit
e80488b619
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user