From cd2826b7541e1381ff353dd0f3864b4c866d322a Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Mon, 10 Jun 2024 16:33:13 +0100 Subject: [PATCH 1/2] Accomodate the move of Collection model in Wagtail 6.0 --- sandbox/home/management/commands/load_fixtures.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sandbox/home/management/commands/load_fixtures.py b/sandbox/home/management/commands/load_fixtures.py index 6fb0366..b7bef12 100644 --- a/sandbox/home/management/commands/load_fixtures.py +++ b/sandbox/home/management/commands/load_fixtures.py @@ -18,7 +18,11 @@ from wagtail.documents.models import Document as WagtailDocument from wagtail.images.models import Image as WagtailImage from wagtail.models import Page, Site -from wagtail.models.collections import Collection + +if WAGTAIL_VERSION >= (6, 0): + from wagtail.models.media import Collection +else: + from wagtail.models.collections import Collection from sandbox.home.models import ( FormFieldOne, From adaa35a2ede588effbb1dcbf62c9bc0a97a50a9c Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Mon, 10 Jun 2024 16:38:25 +0100 Subject: [PATCH 2/2] Add support testing for wagtail 6.1 --- pyproject.toml | 2 +- tox.ini | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7321234..2433131 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies =[ - "Wagtail>=4.1,<6.1", + "Wagtail>=4.1,<6.2", "Django>=3.2,<5.1", ] diff --git a/tox.ini b/tox.ini index 2252280..715ae1e 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ envlist = python{3.11,3.12}-django4.2-wagtail5.1-modeladmin1 python{3.11,3.12}-django4.2-wagtail5.2-modeladmin2 python{3.11,3.12}-django{4.2,5.0}-wagtail6.0-modeladmin2 + python{3.11,3.12}-django{4.2,5.0}-wagtail6.1-modeladmin2 [gh-actions] python = @@ -47,6 +48,7 @@ deps = wagtail5.1: wagtail>=5.1,<5.2 wagtail5.2: wagtail>=5.2,<5.3 wagtail6.0: wagtail>=6.0,<6.1 + wagtail6.1: wagtail>=6.1,<6.2 modeladmin1: wagtail-modeladmin==1.0.0 modeladmin2: wagtail-modeladmin==2.0.0