fields: return TableField's original json value (#54881)

This commit is contained in:
Serghei Mihai 2021-06-15 12:19:02 +02:00
parent a8c4f9e021
commit 467ebb16ca
2 changed files with 5 additions and 0 deletions

View File

@ -639,6 +639,7 @@ def test_formdef_submit_with_varname(pub, local_user):
fields.FileField(id='4', label='foobar4', varname='file'),
fields.MapField(id='5', label='foobar5', varname='map'),
fields.StringField(id='6', label='foobar6', varname='foobar6'),
fields.TableField(id='7', label='table', varname='table', rows=['Person1', 'Person2'], cols=['Name']),
]
formdef.store()
data_class = formdef.data_class()
@ -673,6 +674,7 @@ def test_formdef_submit_with_varname(pub, local_user):
'lat': 1.5,
'lon': 2.25,
},
'table': [['Name1'], ['Name2']],
}
}
resp = get_app(pub).post_json(url, payload)

View File

@ -2764,6 +2764,9 @@ class TableField(WidgetField):
pass
return table
def from_json_value(self, value):
return value
register_field_class(TableField)