0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Update docs for use_json_field

Indicate that this must now be set to True.
This commit is contained in:
Matt Westcott 2023-02-09 19:05:45 +00:00
parent 635db6d850
commit d5f787030a
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ This document details the block types provided by Wagtail for use in [StreamFiel
A model field for representing long-form content as a sequence of content blocks of various types. See :ref:`streamfield_topic`.
:param blocks: A list of block types, passed as either a list of ``(name, block_definition)`` tuples or a ``StreamBlock`` instance.
:param use_json_field: When true, the field uses :class:`~django.db.models.JSONField` as its internal type, allowing the use of ``JSONField`` lookups and transforms. When false, it uses :class:`~django.db.models.TextField` instead. This argument **must** be set to ``True``/``False``.
:param use_json_field: Must be set to ``True``. This causes the field to use :class:`~django.db.models.JSONField` as its internal type, allowing the use of ``JSONField`` lookups and transforms.
:param blank: When false (the default), at least one block must be provided for the field to be considered valid.
:param min_num: Minimum number of sub-blocks that the stream must have.
:param max_num: Maximum number of sub-blocks that the stream may have.
@ -18,8 +18,8 @@ This document details the block types provided by Wagtail for use in [StreamFiel
:param collapsed: When true, all blocks are initially collapsed.
```
```{versionchanged} 3.0
The required `use_json_field` argument is added.
```{versionchanged} 5.0
The `use_json_field` argument must be set to `True`, except in migrations created prior to Wagtail 5.0.
```
```python

View File

@ -45,8 +45,8 @@ You can find the complete list of available block types in the [](streamfield_bl
StreamField is not a direct replacement for other field types such as RichTextField. If you need to migrate an existing field to StreamField, refer to [](streamfield_migrating_richtext).
```
```{versionchanged} 3.0
The `use_json_field=True` argument was added. This indicates that the database's native JSONField support should be used for this field, and is a temporary measure to assist in migrating StreamFields created on earlier Wagtail versions; it will become the default in a future release.
```{versionchanged} 5.0
The `use_json_field=True` argument is required. `use_json_field=False` is only permitted within migrations created before Wagtail 5.0. This is a temporary measure to ensure that all existing StreamFields are upgraded to the database's native JSONField support; it will be removed in a future release.
```
(streamfield_template_rendering)=