[Django]-Single item in Wagtail StreamField

3👍

When using StreamFields and StructBlocks, you can define the min_num and/or max_num of how many of those blocks you want the user to be able to create. See StructBlock docs.

Example:

class MyPage(Page):
    map = StreamField(
        MapBlock(max_num=1, min_num=1, required=True)
    )

This feature was added in 1.12.

Leave a comment