mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 17:23:15 +00:00
define the default value of a StreamBlock to be an empty StreamValue, not a list
This commit is contained in:
parent
89e5f74521
commit
2a485e499e
1 changed files with 6 additions and 1 deletions
|
|
@ -585,7 +585,12 @@ class ListBlock(Block):
|
|||
# ===========
|
||||
|
||||
class BaseStreamBlock(Block):
|
||||
default = []
|
||||
# TODO: decide what it means to pass a 'default' arg to StreamBlock's constructor. Logically we want it to be
|
||||
# of type StreamValue, but we can't construct one of those because it needs a reference back to the StreamBlock
|
||||
# that we haven't constructed yet...
|
||||
@property
|
||||
def default(self):
|
||||
return StreamValue(self, [])
|
||||
|
||||
def __init__(self, local_blocks=None, **kwargs):
|
||||
super(BaseStreamBlock, self).__init__(**kwargs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue