kopia lustrzana https://github.com/wagtail/wagtail
Release notes for #6718
rodzic
49b13a3139
commit
df125b1652
docs
releases
topics
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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<streamfield_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.
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue