mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
Made field label optional in OPTIONS
This commit is contained in:
parent
42b61ffcd7
commit
b915c1d4d8
|
@ -136,11 +136,10 @@ def humanize_field(field):
|
|||
humanized = {
|
||||
'type': humanize_field_type(field.__class__),
|
||||
'required': getattr(field, 'required', False),
|
||||
'label': getattr(field, 'label', None),
|
||||
}
|
||||
optional_attrs = ['read_only', 'help_text']
|
||||
optional_attrs = ['read_only', 'help_text', 'label']
|
||||
for attr in optional_attrs:
|
||||
if hasattr(field, attr):
|
||||
if getattr(field, attr, None) is not None:
|
||||
humanized[attr] = getattr(field, attr)
|
||||
return humanized
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user