New ListBlocks should consist of one empty item by default

This commit is contained in:
Matt Westcott 2015-02-11 13:38:23 +00:00
parent 4603701a59
commit 194535120a

View file

@ -541,7 +541,8 @@ class StructBlock(six.with_metaclass(DeclarativeSubBlocksMetaclass, BaseStructBl
class ListBlock(Block):
class Meta:
default = []
# Default to a list consisting of one empty child item (using None to trigger the child's empty / default rendering)
default = [None]
def __init__(self, child_block, **kwargs):
super(ListBlock, self).__init__(**kwargs)