Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail 6.0 #124

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
wagtail-version:
- 4.1
- 5.1
- 5.2
- 6.0
- 6.1
services:
postgres:
image: postgis/postgis:12-2.5
Expand All @@ -27,9 +27,9 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose"
Expand All @@ -68,8 +68,8 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -82,8 +82,8 @@ jobs:
runs-on: ubuntu-latest
needs: [test, lint-black, lint-isort]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Changelog

## [Unreleased]

### Fixed
- Fix rendering of MapsField when Point is a NoneType (@nickmoreton)

### Added
- Drop support for Wagtail < 5.2 (@katdom13)
- Add support for Wagtail 6.0/6.1 (@katdom13)

### Changed
### Fixed
- Implement stimulus approach to GoogleMapsField, GeocoderField, and LeafletField (@katdom13)

### Removed
- Drop support for Django 4.1 (@katdom13)

## [8.1.1] - 2023.12.29
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-with-google-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Requirements

- Python 3.8+
- Wagtail 4.1+ and Django 3.2+
- Wagtail 5.2+ and Django 4.2+
- A Google account


Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-with-leaflet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Requirements

- Python 3.8+
- Wagtail 4.1+ and Django 3.2+
- Wagtail 5.2+ and Django 4.2+
- Access to a tile provider for Leaflet, this library includes built in support for Open Street Map


Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
Expand All @@ -62,7 +60,7 @@
],
extras_require={"test": test_extras},
install_requires=[
"Wagtail>=4.1",
"Wagtail>=5.2",
],
project_urls={
"Source": "https://github.com/Frojd/wagtail-geo-widget/",
Expand Down
4 changes: 2 additions & 2 deletions tests/geopage/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
import django.db.models.deletion
import modelcluster.fields
from django.db import migrations, models
from wagtail import VERSION as WAGTAIL_VERSION
import wagtail.blocks as wagtail_blocks
import wagtail.fields as wagtail_fields

import wagtailgeowidget.blocks


class Migration(migrations.Migration):

initial = True

dependencies = [
("wagtailcore", "0066_collection_management_permissions"),
]

streamfield_params = {"use_json_field": True}
streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

operations = [
migrations.CreateModel(
Expand Down
3 changes: 2 additions & 1 deletion tests/geopage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from modelcluster.fields import ParentalKey
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import blocks
from wagtail.admin.panels import (
FieldPanel,
Expand Down Expand Up @@ -141,7 +142,7 @@ class GeoPageWithLeaflet(Page):


class GeoStreamPage(Page):
streamfield_params = {"use_json_field": True}
streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

body = StreamField(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/geopage_nospatial/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Generated by Django 4.0.2 on 2022-02-20 16:35
import django.db.models.deletion
from django.db import migrations, models
from wagtail import VERSION as WAGTAIL_VERSION
import wagtail.blocks as wagtail_blocks
import wagtail.fields as wagtail_fields

import wagtailgeowidget.blocks


class Migration(migrations.Migration):

initial = True

dependencies = [
("wagtailcore", "0066_collection_management_permissions"),
]

streamfield_params = {"use_json_field": True}
streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

operations = [
migrations.CreateModel(
Expand Down
3 changes: 2 additions & 1 deletion tests/geopage_nospatial/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import blocks
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtail.fields import StreamField
Expand Down Expand Up @@ -164,7 +165,7 @@ def lng(self):


class StreamPage(Page):
streamfield_params = {"use_json_field": True}
streamfield_params = {"use_json_field": True} if WAGTAIL_VERSION < (6, 0) else {}

body = StreamField(
[
Expand Down
1 change: 0 additions & 1 deletion tests/home/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion tests/search/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.contrib.search_promotions.models import Query
from wagtail.models import Page
from wagtail.search.models import Query


def search(request):
Expand Down