Wagtail: Add ability to specify min/max block counts on StreamField / StreamBlock

Created on 25 Apr 2016  路  3Comments  路  Source: wagtail/wagtail

As requested here: https://groups.google.com/d/msg/wagtail/RLMwoDN_5LA/Endv7GANAQAJ

Suggest this is done with parameters named min_num and max_num, to match #1529.

Related: #2379

Streamfield Enhancement

Most helpful comment

@gasman do you guys have an update on this? Would be amazing to be able to limit the streamblock instances.

All 3 comments

In case it's not possible right now (I haven't tried yet), it would be great to have a min_numand max_num per field in the StreamField.
Examples:

  • One and only one event block.
  • More than two and less than 5 big images.

As I said, maybe it's possible right now but I'm not aware.

@gasman do you guys have an update on this? Would be amazing to be able to limit the streamblock instances.

Fix (#3605) was released in Wagtail 1.12:

StreamBlock now accepts min_num, max_num and block_counts settings to control the minimum and maximum numbers of blocks (Edwar Baron, Matt Westcott)

Closing this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soar picture soar  路  3Comments

lboaretto picture lboaretto  路  3Comments

ocobacho picture ocobacho  路  3Comments

tmsndrs picture tmsndrs  路  3Comments

allcaps picture allcaps  路  3Comments