mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-26 03:53:42 +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__),
|
'type': humanize_field_type(field.__class__),
|
||||||
'required': getattr(field, 'required', False),
|
'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:
|
for attr in optional_attrs:
|
||||||
if getattr(field, attr, None) is not None:
|
if getattr(field, attr, None) is not None:
|
||||||
humanized[attr] = getattr(field, attr)
|
humanized[attr] = getattr(field, attr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user