ソースを参照

Start 2.14 (#7081)

* Version bump to start work on 2.14

* Removed StreamValue.stream_data and StreamValue.TupleView

* Rotate deprecation warning classes

* Set up changelog and release notes for 2.14

* Changelog / release note for #7023

* Add 2.14 to the compatibility table in the upgrading guide
Karl Hobley 3 年 前
コミット
feab09a6d6

+ 6 - 0
CHANGELOG.txt

@@ -1,6 +1,12 @@
 Changelog
 =========
 
+2.14 (xx.xx.xxxx) - IN DEVELOPMENT
+~~~~~~~~~~~~~~~~~
+
+ - Fix: Invalid filter values for foreign key fields in the API now give an error instead of crashing (Tidjani Dia)
+
+
 2.13 (xx.xx.xxxx) - IN DEVELOPMENT
 ~~~~~~~~~~~~~~~~~
 

+ 1 - 0
CONTRIBUTORS.rst

@@ -506,6 +506,7 @@ Contributors
 * Vlad Podgurschi
 * Kevin Breen
 * Ihor Marhitych
+* Tidjani Dia
 
 Translators
 ===========

+ 23 - 0
docs/releases/2.14.rst

@@ -0,0 +1,23 @@
+===========================================
+Wagtail 2.14 release notes - IN DEVELOPMENT
+===========================================
+
+.. contents::
+    :local:
+    :depth: 1
+
+
+What's new
+==========
+
+Other features
+~~~~~~~~~~~~~~
+
+
+Bug fixes
+~~~~~~~~~
+
+ - Invalid filter values for foreign key fields in the API now give an error instead of crashing (Tidjani Dia)
+
+Upgrade considerations
+======================

+ 1 - 0
docs/releases/index.rst

@@ -5,6 +5,7 @@ Release notes
    :maxdepth: 1
 
    upgrading
+   2.14
    2.13
    2.12.4
    2.12.3

+ 2 - 0
docs/releases/upgrading.rst

@@ -143,3 +143,5 @@ The compatible versions of Django and Python for each Wagtail release are:
 +-------------------+------------------------------+-----------------------------+
 | 2.13              | 2.2, 3.0, 3.1, 3.2           | 3.6, 3.7, 3.8, 3.9          |
 +-------------------+------------------------------+-----------------------------+
+| 2.14              | 2.2, 3.0, 3.1, 3.2           | 3.6, 3.7, 3.8, 3.9          |
++-------------------+------------------------------+-----------------------------+

+ 1 - 1
wagtail/__init__.py

@@ -7,7 +7,7 @@ from wagtail.utils.version import get_semver_version, get_version
 
 # major.minor.patch.release.number
 # release must be one of alpha, beta, rc, or final
-VERSION = (2, 13, 0, 'alpha', 0)
+VERSION = (2, 14, 0, 'alpha', 0)
 
 __version__ = get_version(VERSION)
 

+ 0 - 47
wagtail/core/blocks/stream_block.py

@@ -1,6 +1,5 @@
 import itertools
 import uuid
-import warnings
 
 from collections import OrderedDict, defaultdict
 from collections.abc import MutableSequence
@@ -14,7 +13,6 @@ from django.utils.translation import gettext as _
 
 from wagtail.admin.staticfiles import versioned_static
 from wagtail.core.telepath import Adapter, register
-from wagtail.utils.deprecation import RemovedInWagtail214Warning
 
 from .base import Block, BoundBlock, DeclarativeSubBlocksMetaclass, get_help_icon
 
@@ -418,38 +416,6 @@ class StreamValue(MutableSequence):
         def __repr__(self):
             return repr(list(self))
 
-    class TupleView(MutableSequence):
-        """
-        RemovedInWagtail214Warning:
-        Internal helper class to replicate the old behaviour of StreamValue.stream_data on a
-        non-lazy StreamValue. This only exists for backwards compatibility and can be dropped
-        once stream_data has been retired.
-        """
-        def __init__(self, stream_value):
-            self.stream_value = stream_value
-
-        def __getitem__(self, i):
-            # convert BoundBlock to tuple representation on retrieval
-            return self.stream_value[i]._as_tuple()
-
-        # all other methods can be proxied directly to StreamValue, since its assignment /
-        # insertion methods accept the tuple representation
-
-        def __len__(self):
-            return len(self.stream_value)
-
-        def __setitem__(self, i, item):
-            self.stream_value[i] = item
-
-        def __delitem__(self, i):
-            del self.stream_value[i]
-
-        def insert(self, i, item):
-            self.stream_value.insert(i, item)
-
-        def __repr__(self):
-            return repr(list(self))
-
     def __init__(self, stream_block, stream_data, is_lazy=False, raw_text=None):
         """
         Construct a StreamValue linked to the given StreamBlock,
@@ -530,19 +496,6 @@ class StreamValue(MutableSequence):
     def raw_data(self):
         return StreamValue.RawDataView(self)
 
-    @cached_property
-    def stream_data(self):
-        warnings.warn(
-            "The stream_data property of StreamField / StreamBlock values is deprecated.\n"
-            "HINT: Instead of value.stream_data[i], retrieve block objects with value[i] "
-            "or access the raw JSON-like data via value.raw_data[i].",
-            RemovedInWagtail214Warning
-        )
-        if self.is_lazy:
-            return StreamValue.RawDataView(self)
-        else:
-            return StreamValue.TupleView(self)
-
     def _prefetch_blocks(self, type_name):
         """
         Populate _bound_blocks with all items in this stream of type `type_name` that exist in

+ 1 - 1
wagtail/project_template/requirements.txt

@@ -1,2 +1,2 @@
 Django>=3.2,<3.3
-wagtail==2.13a0
+wagtail==2.14a0

+ 3 - 3
wagtail/utils/deprecation.py

@@ -3,14 +3,14 @@ import warnings
 from importlib import import_module
 
 
-class RemovedInWagtail214Warning(DeprecationWarning):
+class RemovedInWagtail215Warning(DeprecationWarning):
     pass
 
 
-removed_in_next_version_warning = RemovedInWagtail214Warning
+removed_in_next_version_warning = RemovedInWagtail215Warning
 
 
-class RemovedInWagtail215Warning(PendingDeprecationWarning):
+class RemovedInWagtail216Warning(PendingDeprecationWarning):
     pass