mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
fixup! Add form data helpers
This commit is contained in:
parent
bed10c31cb
commit
7a15996d60
@ -212,11 +212,11 @@ class TestFormDataHelpers(TestCase):
|
||||
'content-count': '2',
|
||||
'content-0-type': 'text',
|
||||
'content-0-value': 'Hello, world',
|
||||
'content-0-order': 0,
|
||||
'content-0-order': '0',
|
||||
'content-0-deleted': '',
|
||||
'content-1-type': 'text',
|
||||
'content-1-value': 'Goodbye, world',
|
||||
'content-1-order': 1,
|
||||
'content-1-order': '1',
|
||||
'content-1-deleted': '',
|
||||
}
|
||||
)
|
||||
|
@ -58,13 +58,13 @@ def streamfield(items):
|
||||
# 'content-count': '1',
|
||||
# 'content-0-type': 'text',
|
||||
# 'content-0-value': 'Hello, world',
|
||||
# 'content-0-order': 0,
|
||||
# 'content-0-order': '0',
|
||||
# 'content-0-deleted': '',
|
||||
# }
|
||||
"""
|
||||
def to_block(index, item):
|
||||
block, value = item
|
||||
return {'type': block, 'value': value, 'deleted': '', 'order': index}
|
||||
return {'type': block, 'value': value, 'deleted': '', 'order': str(index)}
|
||||
data_dict = {str(index): to_block(index, item)
|
||||
for index, item in enumerate(items)}
|
||||
data_dict['count'] = str(len(data_dict))
|
||||
|
Loading…
Reference in New Issue
Block a user