wagtail/docs/releases/2.13.rst

63 wiersze
3.3 KiB
ReStructuredText
Czysty Wina Historia

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

===========================================
Wagtail 2.13 release notes - IN DEVELOPMENT
===========================================
.. contents::
:local:
:depth: 1
What's new
==========
Other features
~~~~~~~~~~~~~~
* Support passing ``min_num``, ``max_num`` and ``block_counts`` arguments directly to ``StreamField`` (Haydn Greatnews, Matt Westcott)
* Add the option to set rich text images as decorative, without alt text (Helen Chapman, Thibaud Colas)
* Add support for ``__year`` filter in Elasticsearch queries (Seb Brown)
* Add ``PageQuerySet.defer_streamfields()`` (Andy Babic)
* Utilize ``PageQuerySet.defer_streamfields()`` to improve efficiency in a few key places (Andy Babic)
* Support passing multiple models as arguments to ``type()``, ``not_type()``, ``exact_type()`` and ``not_exact_type()`` methods on ``PageQuerySet`` (Andy Babic)
* Update default attribute copying behaviour of ``Page.get_specific()`` and added the ``copy_attrs_exclude`` option (Andy Babic)
* Update ``PageQueryset.specific(defer=True)`` to only perform a single database query (Andy Babic)
* Switched ``register_setting``, ``register_settings_menu_item`` to use SVG icons (Thibaud Colas)
* Add support to SVG icons for ``SearchArea`` subclasses in ``register_admin_search_area`` (Thibaud Colas)
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)
* Make image chooser "Select format" fields translatable (Helen Chapman, Thibaud Colas)
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.
Switched ``register_setting``, ``register_settings_menu_item`` to use SVG icons
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting menu items now use SVG icons by default. For sites reusing built-in Wagtail icons, no changes should be required. For sites using custom font icons, update the menu items definition to use the ``classnames`` attribute:
.. code-block:: python
# With register_setting,
# Before:
@register_setting(icon='custom-cog')
# After:
@register_setting(icon='', classnames='icon icon-custom-cog')
# Or with register_settings_menu_item,
@hooks.register('register_settings_menu_item')
def register_frank_menu_item():
# Before:
return SettingMenuItem(CustomSetting, icon='custom-cog')
# After:
return SettingMenuItem(CustomSetting, icon='', classnames='icon icon-custom-cog')