Housekeeping to start work on 4.0 (#8420)

* Add release notes page for 4.0

* Version bump to 4.0

* Rotate deprecation warnings
pull/8304/head
Matt Westcott 2022-04-22 14:25:16 +01:00 zatwierdzone przez GitHub
rodzic 90ccbff15b
commit 262e94401a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
9 zmienionych plików z 40 dodań i 16 usunięć

Wyświetl plik

@ -1,12 +1,12 @@
Changelog
=========
unreleased (xx.xx.xxxx) - IN DEVELOPMENT
4.0 (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~
* Add clarity to confirmation when being asked to convert an external link to an internal one (Thijs Kramer)
* Convert various pages in the documentation to Markdown (Daniel Kirkham)
* Add `base_url_path` to `ModelAdmin` so that the default URL structure of app_label/model_name can be overridden, sub-classes of `AdminURLHelper` overriding `__init__` will need to accept a new kwarg of `base_url_path` (Vu Pham, Khanh Hoang)
* Add `base_url_path` to `ModelAdmin` so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)
* Add `full_url` to the API output of `ImageRenditionField` (Paarth Agarwal)

Wyświetl plik

@ -415,7 +415,6 @@ document.addEventListener('DOMContentLoaded', () => {
// We couldn't implement this for Wagtail 3.0 as the existing field styling
// renders the "Add comment" button on the right hand side, and this gets
// covered up by the side panel.
// RemovedInWagtail40Warning
if (panelName === '' || panelName === 'comments') {
sidePanelWrapper.classList.remove('form-side--open');

Wyświetl plik

@ -0,0 +1,28 @@
# Wagtail 4.0 release notes - IN DEVELOPMENT
```{contents}
---
local:
depth: 1
---
```
## What's new
### Other features
* Add clarity to confirmation when being asked to convert an external link to an internal one (Thijs Kramer)
* Convert various pages in the documentation to Markdown (Daniel Kirkham)
* Add `base_url_path` to `ModelAdmin` so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)
* Add `full_url` to the API output of `ImageRenditionField` (Paarth Agarwal)
### Bug fixes
* ...
## Upgrade considerations
### `base_url_path` keyword argument added to AdminURLHelper
The `wagtail.contrib.modeladmin.helpers.AdminURLHelper` class now accepts a `base_url_path` keyword argument on its constructor. Custom subclasses of this class should be updated to accept this keyword argument.

Wyświetl plik

@ -5,6 +5,7 @@ Release notes
:maxdepth: 1
upgrading
4.0
3.0
2.16.2
2.16.1

Wyświetl plik

@ -6,7 +6,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 = (3, 0, 0, "alpha", 0)
VERSION = (4, 0, 0, "alpha", 0)
__version__ = get_version(VERSION)

Wyświetl plik

@ -1,6 +1,6 @@
import json
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.db.models.fields.json import KeyTransform
@ -8,7 +8,6 @@ from django.utils.encoding import force_str
from wagtail.blocks import Block, BlockField, StreamBlock, StreamValue
from wagtail.rich_text import get_text_for_indexing
from wagtail.utils.deprecation import RemovedInWagtail40Warning
class RichTextField(models.TextField):
@ -100,10 +99,8 @@ class StreamField(models.Field):
def _check_json_field(self):
if type(self.use_json_field) is not bool:
warnings.warn(
raise ImproperlyConfigured(
f"StreamField must explicitly set use_json_field argument to True/False instead of {self.use_json_field}.",
RemovedInWagtail40Warning,
stacklevel=3,
)
def get_internal_type(self):

Wyświetl plik

@ -1,2 +1,2 @@
Django>=4.0,<4.1
wagtail==3.0a0
wagtail==4.0a0

Wyświetl plik

@ -3,6 +3,7 @@ import json
from unittest import skip
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, models
from django.template import Context, Template, engines
from django.test import TestCase, skipUnlessDBFeature
@ -22,7 +23,6 @@ from wagtail.test.testapp.models import (
MinMaxCountStreamModel,
StreamModel,
)
from wagtail.utils.deprecation import RemovedInWagtail40Warning
class TestLazyStreamField(TestCase):
@ -231,8 +231,7 @@ class TestUseJsonFieldWarning(TestCase):
apps.clear_cache()
def test_system_check_validates_block(self):
message = "StreamField must explicitly set use_json_field argument to True/False instead of None."
with self.assertWarnsMessage(RemovedInWagtail40Warning, message):
with self.assertRaises(ImproperlyConfigured):
class DeprecatedStreamModel(models.Model):
body = StreamField(

Wyświetl plik

@ -2,14 +2,14 @@ import warnings
from importlib import import_module
class RemovedInWagtail40Warning(DeprecationWarning):
class RemovedInWagtail50Warning(DeprecationWarning):
pass
removed_in_next_version_warning = RemovedInWagtail40Warning
removed_in_next_version_warning = RemovedInWagtail50Warning
class RemovedInWagtail50Warning(PendingDeprecationWarning):
class RemovedInWagtail60Warning(PendingDeprecationWarning):
pass