Reputation: 539
The title says it all, I haven't been able to find any other information online. I'm wondering if it is possible for me to get
secondary_links = StreamField([
('Page', SerialisedPageChooserBlock())])
to accept exactly two blocks.
Upvotes: 1
Views: 2384
Reputation: 25317
Yes, this is possible as of Wagtail 1.12, with the min_num
and max_num
properties on StreamBlock:
secondary_links = StreamField(
StreamBlock([
('Page', SerialisedPageChooserBlock())
], min_num=2, max_num=2)
)
Upvotes: 5