Include 'initial' attribute of serializer fields in metadata responses

Frontend applications may now use the response of an OPTIONS request so as to populate the fields for "add/new/create" type of forms with initial values based on the 'initial' attribute of the serializer's fields.
This commit is contained in:
Petros Moisiadis 2015-12-16 20:59:46 +02:00
parent 00ead782d4
commit fc0ec571c2

View File

@ -124,7 +124,8 @@ class SimpleMetadata(BaseMetadata):
attrs = [
'read_only', 'label', 'help_text',
'min_length', 'max_length',
'min_value', 'max_value'
'min_value', 'max_value',
'initial'
]
for attr in attrs: