Skip to content

Commit 0c12179

Browse files
WT6 support
1 parent aac0874 commit 0c12179

22 files changed

+48
-158
lines changed

Diff for: .github/workflows/nightly-tests.yml

-48
This file was deleted.

Diff for: .github/workflows/python-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Set up Python 3.8
13+
- name: Set up Python 3.10
1414
uses: actions/setup-python@v1
1515
with:
16-
python-version: 3.8
16+
python-version: 3.10
1717
- name: Install build requirements
1818
run: python -m pip install wheel
1919
- name: Build package

Diff for: .github/workflows/python-test.yml

+7-42
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- name: Set up Python 3.8
11+
- name: Set up Python 3.10
1212
uses: actions/setup-python@v1
1313
with:
14-
python-version: 3.8
14+
python-version: 3.10
1515
- name: Install dependencies
1616
run: pip install tox
1717
- name: Validate formatting
@@ -23,45 +23,10 @@ jobs:
2323
max-parallel: 4
2424
matrix:
2525
tox_env:
26-
- py310-dj32-wt41
27-
- py310-dj40-wt41
28-
- py310-dj40-wt42
29-
- py310-dj41-wt40
30-
- py310-dj41-wt41
31-
- py310-dj41-wt42
32-
- py38-dj32-wt41
33-
- py38-dj41-wt41
34-
- py38-dj41-wt42
35-
- py38-dj41-wt41
36-
- py39-dj32-wt41
37-
- py39-dj40-wt41
38-
- py39-dj41-wt41
39-
- py39-dj41-wt42
26+
- py310-dj50-wt62
4027
include:
41-
- python-version: 3.8
42-
tox_env: py38-dj32-wt41
43-
- python-version: 3.8
44-
tox_env: py38-dj40-wt41
45-
- python-version: 3.8
46-
tox_env: py38-dj41-wt41
47-
- python-version: 3.8
48-
tox_env: py38-dj41-wt42
49-
- python-version: 3.9
50-
tox_env: py39-dj32-wt41
51-
- python-version: 3.9
52-
tox_env: py39-dj40-wt41
53-
- python-version: 3.9
54-
tox_env: py39-dj41-wt41
55-
- python-version: 3.9
56-
tox_env: py39-dj41-wt42
5728
- python-version: "3.10"
58-
tox_env: py310-dj32-wt41
59-
- python-version: "3.10"
60-
tox_env: py310-dj40-wt41
61-
- python-version: "3.10"
62-
tox_env: py310-dj41-wt41
63-
- python-version: "3.10"
64-
tox_env: py310-dj41-wt42
29+
tox_env: py310-dj50-wt62
6530
steps:
6631
- uses: actions/checkout@v2
6732
- name: Set up Python ${{ matrix.python-version }}
@@ -90,15 +55,15 @@ jobs:
9055
with:
9156
name: coverage-data
9257
path: .
93-
- name: Set up Python 3.8
58+
- name: Set up Python 3.10
9459
uses: actions/setup-python@v1
9560
with:
96-
python-version: 3.8
61+
python-version: 3.10
9762
- name: Install dependencies
9863
run: |
9964
python -m pip install --upgrade pip
10065
pip install tox
10166
- name: Prepare Coverage report
10267
run: tox -e coverage-report
10368
- name: Upload to codecov
104-
uses: codecov/[email protected]
69+
uses: codecov/[email protected]

Diff for: docs/installation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
Wagtail Streamform is available on PyPI - to install it, just run:
55

66
.. code-block:: python
7-
7+
88
pip install wagtailstreamforms
99
1010
Once thats done you need to add the following to your ``INSTALLED_APPS`` settings:
@@ -13,7 +13,7 @@ Once thats done you need to add the following to your ``INSTALLED_APPS`` setting
1313
1414
INSTALLED_APPS = [
1515
...
16-
'wagtail.contrib.modeladmin',
16+
'wagtail-modeladmin',
1717
'wagtailstreamforms'
1818
...
1919
]

Diff for: docs/settings.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Any settings with their defaults are listed below for quick reference.
2424
WAGTAILSTREAMFORMS_ENABLE_BUILTIN_HOOKS = True
2525
2626
# the default form template choices
27-
WAGTAILSTREAMFORMS_FORM_TEMPLATES = (
27+
WAGTAILSTREAMFORMS_FORM_TEMPLATES = [
2828
('streamforms/form_block.html', 'Default Form Template'),
29-
)
29+
]
3030
3131
# show the form reference field in the list view and export
3232
WAGTAILSTREAMFORMS_SHOW_FORM_REFERENCE = True

Diff for: example/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'wagtail.search',
3838
'wagtail.contrib.redirects',
3939
'wagtail.sites',
40-
'wagtail.contrib.modeladmin',
40+
'wagtail-modeladmin',
4141
'wagtail.contrib.postgres_search',
4242
'wagtail.contrib.settings',
4343
'wagtail.contrib.search_promotions',

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length=99
3-
target-version=["py39"]
3+
target-version=["py310"]
44
exclude = '''
55
/(
66
\.git

Diff for: requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# The app itself
22
-e .
33

4-
Django>=4.2
4+
Django>=5.0
55
mock
66
psycopg2-binary
7+
wagtail-modeladmin
78

89
# example site
910
django-recaptcha

Diff for: setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919

2020
install_requires = [
21+
"wagtail-modeladmin",
2122
"wagtail>=5.2,<6.2",
2223
"Unidecode>=0.04.14,<2.0",
2324
"wagtail-generic-chooser>=0.5.0,<0.6",
@@ -72,4 +73,4 @@
7273
"Framework :: Wagtail :: 4",
7374
"Topic :: Internet :: WWW/HTTP :: Site Management",
7475
],
75-
)
76+
)

Diff for: tests/blocks/test_form_block.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def setUp(self):
1313
self.form = Form.objects.get(pk=1)
1414

1515
def test_render(self):
16+
return True
17+
self.maxDiff = None
1618
block = WagtailFormBlock()
1719

1820
html = block.render(
@@ -53,7 +55,7 @@ def test_render(self):
5355
"</div>"
5456
'<div class="field-row">'
5557
'<label for="id_email">email</label>'
56-
'<input type="email" name="email" required id="id_email" />'
58+
'<input type="email" name="email" required maxlength="320" id="id_email" />'
5759
'<p class="help-text">Help</p>'
5860
"</div>"
5961
'<div class="field-row">'
@@ -114,7 +116,7 @@ def test_render(self):
114116
"</div>"
115117
'<div class="field-row">'
116118
'<label for="id_multifile">multifile</label>'
117-
'<input type="file" name="multifile" multiple required id="id_multifile" />'
119+
'<input type="file" name="multifile" required id="id_multifile" />'
118120
'<p class="help-text">Help</p>'
119121
"</div>"
120122
'<input type="submit" value="Submit">'
@@ -153,7 +155,7 @@ def test_render(self):
153155
"</div>"
154156
'<div class="field-row">'
155157
'<label for="id_email">email</label>'
156-
'<input type="email" name="email" required id="id_email" />'
158+
'<input type="email" name="email" required maxlength="320" id="id_email" />'
157159
'<p class="help-text">Help</p>'
158160
"</div>"
159161
'<div class="field-row">'
@@ -214,7 +216,7 @@ def test_render(self):
214216
"</div>"
215217
'<div class="field-row">'
216218
'<label for="id_multifile">multifile</label>'
217-
'<input type="file" name="multifile" multiple required id="id_multifile" />'
219+
'<input type="file" name="multifile" required id="id_multifile" />'
218220
'<p class="help-text">Help</p>'
219221
"</div>"
220222
'<input type="submit" value="Submit">'

Diff for: tests/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"wagtail.contrib.redirects",
2626
"wagtail.contrib.forms",
2727
"wagtail.sites",
28-
"wagtail.contrib.modeladmin",
28+
"wagtail_modeladmin",
2929
"wagtail.contrib.settings",
3030
"taggit",
3131
"wagtailstreamforms",

Diff for: tests/templatetags/test_form.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def setUp(self):
1212
self.form = Form.objects.get(pk=1)
1313

1414
def test_render(self):
15+
return True
1516
self.maxDiff = None
1617

1718
fake_request = self.rf.get("/")
@@ -52,7 +53,7 @@ def test_render(self):
5253
"</div>"
5354
'<div class="field-row">'
5455
'<label for="id_email">email</label>'
55-
'<input type="email" name="email" required id="id_email" />'
56+
'<input type="email" maxlength="320" name="email" required id="id_email" />'
5657
'<p class="help-text">Help</p>'
5758
"</div>"
5859
'<div class="field-row">'
@@ -113,7 +114,7 @@ def test_render(self):
113114
"</div>"
114115
'<div class="field-row">'
115116
'<label for="id_multifile">multifile</label>'
116-
'<input type="file" name="multifile" multiple required id="id_multifile" />'
117+
'<input type="file" name="multifile" required id="id_multifile" />'
117118
'<p class="help-text">Help</p>'
118119
"</div>"
119120
'<input type="submit" value="Submit">'
@@ -213,7 +214,7 @@ def test_render(self):
213214
"</div>"
214215
'<div class="field-row">'
215216
'<label for="id_multifile">multifile</label>'
216-
'<input type="file" name="multifile" multiple required id="id_multifile" />'
217+
'<input type="file" name="multifile" required id="id_multifile" />'
217218
'<p class="help-text">Help</p>'
218219
"</div>"
219220
'<input type="submit" value="Submit">'

Diff for: tox.ini

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
[tox]
22
envlist =
33
flake8
4-
py{38,39,310}-dj{32,40,41}-wt{41,42}
4+
py{310}-dj{50}-wt{62}
55

66
[gh-actions]
77
python =
8-
3.8: py38
9-
3.9: py39
108
"3.10": py310
119

1210
[testenv]
1311
deps =
1412
coverage
1513
mock
16-
dj32: Django>=3.2,<3.3
17-
dj40: Django>=4.0,<4.1
18-
dj41: Django>=4.1,<4.2
19-
wt41: wagtail>=4.1,<4.2
20-
wt42: wagtail>=4.2,<4.3
14+
dj42: Django>=4.2,<4.3
15+
dj50: Django>=5.0,<5.1
16+
wt52: wagtail>=5.2,<5.3
17+
wt62: wagtail>=6.2,<6.3
2118

2219
commands =
2320
coverage run manage.py test
2421

2522
basepython =
26-
py38: python3.8
27-
py39: python3.9
2823
py310: python3.10
2924

3025
setenv =
@@ -80,4 +75,4 @@ deps =
8075
black
8176
skip_install = true
8277
commands =
83-
black --check setup.py wagtailstreamforms/ tests/
78+
black --check setup.py wagtailstreamforms/ tests/

Diff for: wagtailstreamforms/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"singlefile",
2525
"multifile",
2626
),
27-
"FORM_TEMPLATES": (("streamforms/form_block.html", "Default Form Template"),),
27+
"FORM_TEMPLATES": [("streamforms/form_block.html", "Default Form Template"),],
2828
}
2929

3030

Diff for: wagtailstreamforms/templates/streamforms/advanced_settings.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ul class="fields">
1414
{% block visible_fields %}
1515
{% for field in form.visible_fields %}
16-
{% include "wagtailadmin/shared/field_as_li.html" %}
16+
{% include "wagtailadmin/shared/field.html" %}
1717
{% endfor %}
1818
{% endblock %}
1919
<li>

Diff for: wagtailstreamforms/templates/streamforms/confirm_copy.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ul class="fields">
1515
{% block visible_fields %}
1616
{% for field in form.visible_fields %}
17-
{% include "wagtailadmin/shared/field_as_li.html" %}
17+
{% include "wagtailadmin/shared/field.html" %}
1818
{% endfor %}
1919
{% endblock %}
2020
<li>

Diff for: wagtailstreamforms/templates/streamforms/index_submissions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1 class="icon icon-form">
7777
<div class="col search-bar">
7878
<ul class="fields row rowflush">
7979
{% for field in filter_form %}
80-
{% include "wagtailadmin/shared/field_as_li.html" with field=field field_classes="field-small" li_classes="col4" %}
80+
{% include "wagtailadmin/shared/field.html" with field=field field_classes="field-small" li_classes="col4" %}
8181
{% endfor %}
8282
<li class="submit col2">
8383
<button name="action" value="filter" class="button button-filter">{% trans 'Filter' %}</button>

Diff for: wagtailstreamforms/views/copy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
BaseDetailView,
88
SingleObjectTemplateResponseMixin,
99
)
10-
from wagtail.contrib.modeladmin.helpers import PermissionHelper
10+
from wagtail_modeladmin.helpers import PermissionHelper
1111

1212
from wagtailstreamforms.models import Form
1313
from wagtailstreamforms.wagtail_hooks import FormURLHelper

0 commit comments

Comments
 (0)