From df125b165209d4c80082cff5502c4e22dc3ad3fd Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 26 Jan 2021 10:54:45 +0000 Subject: [PATCH] Release notes for #6718 --- CHANGELOG.txt | 2 ++ docs/releases/2.13.rst | 7 ++++++- docs/topics/streamfield.rst | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 40ce8a90ec..90ebb5b62b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,8 @@ Changelog 2.13 (xx.xx.xxxx) - IN DEVELOPMENT ~~~~~~~~~~~~~~~~~ + * Support passing `min_num`, `max_num` and `block_counts` arguments directly to `StreamField` (Haydn Greatnews, Matt Westcott) + * Fix: StreamField required status is now consistently handled by the `blank` keyword argument (Matt Westcott) * Fix: Show 'required' asterisks for blocks inside required StreamFields (Matt Westcott) diff --git a/docs/releases/2.13.rst b/docs/releases/2.13.rst index d63da04b27..7b1cecf3f3 100644 --- a/docs/releases/2.13.rst +++ b/docs/releases/2.13.rst @@ -13,15 +13,20 @@ What's new Other features ~~~~~~~~~~~~~~ - * ... + * Support passing ``min_num``, ``max_num`` and ``block_counts`` arguments directly to ``StreamField`` (Haydn Greatnews, Matt Westcott) Bug fixes ~~~~~~~~~ + * StreamField required status is now consistently handled by the ``blank`` keyword argument (Matt Westcott) * Show 'required' asterisks for blocks inside required StreamFields (Matt Westcott) Upgrade considerations ====================== +Updated handling of non-required StreamFields +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The rules for determining whether a StreamField is required (i.e. at least one block must be provided) have been simplified and made consistent with other field types. Non-required fields are now indicated by ``blank=True`` on the ``StreamField`` definition; the default is ``blank=False`` (the field is required). In previous versions, to make a field non-required, it was necessary to define :ref:`a top-level StreamBlock` with ``required=False`` (which applied the validation rule) as well as setting ``blank=True`` (which removed the asterisk from the form field). You should review your use of StreamField to check that ``blank=True`` is used on the fields you wish to make optional. diff --git a/docs/topics/streamfield.rst b/docs/topics/streamfield.rst index 1cf445c176..1a3a727abb 100644 --- a/docs/topics/streamfield.rst +++ b/docs/topics/streamfield.rst @@ -535,6 +535,7 @@ As with StructBlock, the list of sub-blocks can also be provided as a subclass o class Meta: icon='cogs' +.. _streamfield_top_level_streamblock: Since ``StreamField`` accepts an instance of ``StreamBlock`` as a parameter, in place of a list of block types, this makes it possible to re-use a common set of block types without repeating definitions: