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 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
558d8ec
Fix test app import: Wagtail 5.0 - wagtailsearch.Query has moved to w…
katdom13 Feb 20, 2024
f95b06f
Update supported Wagtail versions
katdom13 Feb 20, 2024
0ca391f
Wagtail 6.0 upgrade consideration: use_json_field is no longer a requ…
katdom13 Feb 20, 2024
2335654
GoogleMapsField: Wagtail 6.0 upgrade consideration: The class WidgetW…
katdom13 Feb 21, 2024
9ea4801
Update tests from GoogleMapsFieldTestCase
katdom13 Feb 21, 2024
8633a23
GeocoderField: Wagtail 6.0 upgrade consideration: The class WidgetWit…
katdom13 Feb 21, 2024
a64a017
Update tests from GeocoderFieldTestCase
katdom13 Feb 21, 2024
bdd6b18
LeafletField: Wagtail 6.0 upgrade consideration: The class WidgetWith…
katdom13 Feb 21, 2024
807c4b7
Update tests from LeafletCase
katdom13 Feb 21, 2024
7e84d08
Linting
katdom13 Feb 21, 2024
e86f4fa
Update CHANGELOG.md
katdom13 Feb 21, 2024
2c88b65
Update TypeError messages on render
katdom13 Feb 21, 2024
a899a93
Merge pull request #2 from torchbox-forks/support/wagtail-60
katdom13 Mar 13, 2024
1ab86c6
Update wagtailgeowidget/widgets.py
katdom13 Apr 2, 2024
c26f821
Need to check if Point is defined before checking if self.value_data …
nickmoreton May 17, 2024
95da44e
Merge pull request #5 from torchbox-forks/fix/wagtail-60-value-data
katdom13 May 20, 2024
130646b
Add fixed to unreleased
katdom13 May 20, 2024
cab04e8
Update workflow actions, Add Wagtail 6.1
katdom13 May 17, 2024
6407f5e
Drop Django < 4.2, Update classifiers
katdom13 May 17, 2024
bb4e6b2
Update changelog
katdom13 May 17, 2024
67fcbe7
Merge pull request #4 from torchbox-forks/support/wagtail61
katdom13 May 24, 2024
e9ad06c
Wagtail 6.2
engineervix Aug 28, 2024
379a6b1
Bump postgres to v13 because Django 5.1 doesn't support v12
engineervix Aug 28, 2024
07ddecf
MaintainerDeprecated: Maintainer instruction is deprecated in favor o…
engineervix Aug 28, 2024
d20ea77
Add missing templates for testing
engineervix Aug 29, 2024
672f231
Fix super() call in tests.geopage.models.ClassicGeoPage
engineervix Aug 29, 2024
3b6602e
Add missing "wagtail.contrib.search_promotions" in test settings
engineervix Aug 29, 2024
fbce7b5
Merge pull request #6 from torchbox-forks/support/wagtail62
engineervix Sep 9, 2024
4d899ab
Adjust test matrix for Wagtail 6.3 and Django 5.1
nickmoreton Nov 26, 2024
55e04f4
Adjust matrix to ensure testing against Django 5.1
nickmoreton Nov 26, 2024
b448b5c
Update CHANGELOG
nickmoreton Nov 28, 2024
7575fd3
Merge pull request #7 from torchbox-forks/support/wagtail-63
nickmoreton Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
wagtail-version:
- 4.1
- 5.1
- 5.2
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
wagtail-version: ["5.2", "6.2", "6.3"]
django-version: ["4.2", "5.0", "5.1"]
exclude:
- python-version: "3.13"
django-version: "4.2"
- python-version: "3.13"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.1"
- wagtail-version: "5.2"
django-version: "5.1"
- wagtail-version: "6.2"
django-version: "5.1"
services:
postgres:
image: postgis/postgis:12-2.5
image: postgis/postgis:13-3.4
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
Expand All @@ -27,9 +38,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 +68,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,10 +79,10 @@ 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
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -82,10 +93,10 @@ 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
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# Changelog

## [Unreleased]

- Update CI testing matrix to test against python 3.9 to 3.13
- Update CI testing matrix to test against wagtail 5.2 to 6.3
- Update CI testing matrix to test against Django 4.2 to 5.1
- Update classifiers to include Django 5.1 and Python 3.13
- Drop testing around python 3.8

### 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)
- Add support for Wagtail 6.2 (@engineervix)

### 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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.12-slim
MAINTAINER Frojd
LABEL maintainer="Frojd"
LABEL version="v0.1.0"

ENV PYTHONUNBUFFERED=1 \
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Local/Dev
version: '3'
version: "3"
services:
web:
image: frojd/geo-widget-web
Expand All @@ -20,7 +20,7 @@ services:
- DATABASE_PORT=5432
env_file: web.env
db:
image: postgis/postgis:12-2.5
image: postgis/postgis:13-3.4
restart: always
environment:
- POSTGRES_USER=postgres
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
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,28 @@
"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 :: Django :: 5.1",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"Framework :: Wagtail :: 6",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Utilities",
],
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
1 change: 1 addition & 0 deletions tests/examplesite/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"wagtail.documents",
"wagtail.images",
"wagtail.search",
"wagtail.contrib.search_promotions",
"wagtail.admin",
"wagtail",
]
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
5 changes: 3 additions & 2 deletions 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 Expand Up @@ -271,7 +272,7 @@ class ClassicGeoPageWithLeaflet(Page):
]

def get_context(self, request):
data = super(ClassicGeoPage, self).get_context(request)
data = super().get_context(request)
return data

@cached_property
Expand Down
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/classic_geo_page_with_leaflet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/classic_geo_page_with_zoom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.point }}
</li>
<li>
Lat: {{ page.lat }}
</li>
<li>
Lng: {{ page.lng }}
</li>
</ul>
{% endblock %}
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/geo_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.location.tuple }}
</li>
<li>
Lat: {{ page.location.y }}
</li>
<li>
Lng: {{ page.location.x }}
</li>
</ul>
{% endblock %}
18 changes: 18 additions & 0 deletions tests/geopage/templates/geopage/geo_page_with_leaflet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>

<ul>
<li>
Point: {{ page.location.tuple }}
</li>
<li>
Lat: {{ page.location.y }}
</li>
<li>
Lng: {{ page.location.x }}
</li>
</ul>
{% endblock %}
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
Loading