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 = [ attrs = [
'read_only', 'label', 'help_text', 'read_only', 'label', 'help_text',
'min_length', 'max_length', 'min_length', 'max_length',
'min_value', 'max_value' 'min_value', 'max_value',
'initial',
] ]
for attr in attrs: for attr in attrs:

View File

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