I want a user to be able to add 0..X related links to a StreamField block. Using a ListBlock (see below) this works, but an empty related-link field always appears in the admin when a user creates a new container-block - which is a problem as the user has to delete it if there are no related links or gets an error that it's fields are required when trying to save the model. Is it possible to make this default to not appear, so the user has to click to add a related-link before the fields will appear?
I define a field to be a ListBlock of another StructBlock (links to related pages):
class LinkBlock(blocks.StructBlock):
link_text = blocks.CharBlock(required=True)
page = blocks.PageChooserBlock(required=True)
class PanelBlock(blocks.StructBlock):
...
related_links = blocks.ListBlock(LinkBlock(required=False), required=False)
This works in that the user can click to add more related links, but when a panel block is added it will always show in the admin with an initial empty related-link block. I want to make it so when a PanelBlock is created an empty panel-link is not shown in the admin, so the user needs to actually click to add one. I've added the "required=False" to try and get this behavior to no effect.