Add field's initial value to metadata

This commit is contained in:
Adam Duren 2016-03-18 23:59:13 -04:00
parent 3645388547
commit 613b5a61d3
2 changed files with 6 additions and 2 deletions

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:

View File

@ -135,10 +135,12 @@ class TestMetadata:
'required': True,
'read_only': False,
'label': 'List field',
'initial': '[]',
'child': {
'type': 'list',
'required': True,
'read_only': False,
'initial': '[]',
'child': {
'type': 'integer',
'required': True,
@ -322,7 +324,8 @@ class TestModelSerializerMetadata(TestCase):
'type': 'field',
'required': False,
'read_only': True,
'label': 'Children'
'label': 'Children',
'initial': '[]',
},
'integer_field': {
'type': 'integer',