Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
current_version = 0.15.2
current_version = 0.16.0
parse = (?P<major>\d+)\.(?P<minor>\d+)((rc(?P<rc>\d+))|(\.(?P<patch>\d+)))
serialize =
serialize =
{major}.{minor}rc{rc}
{major}.{minor}.{patch}
commit = False
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,40 @@ on:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Lint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python: [3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install black
run: |
python -m pip install --upgrade pip
pip install --upgrade pip
pip install black
- name: Lint with black
run: |
black wagtail_modeltranslation
Test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
django-modeltranslation: ["0.19"]
wagtail: ["5.2", "6.0"]
wagtail: ["5.2", "6.3", "7.0"]
database: ["sqlite", "postgres", "mysql"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -71,9 +77,9 @@ jobs:
POSTGRES_USER: "wagtail_modeltranslation"
POSTGRES_PASSWORD: "wagtail_modeltranslation"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Set up env
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ Supported versions
- >= 5.2
- >= 4.2
- 3.9, 3.10, 3.11, 3.12
* - 0.16
- >= 6.3
- >= 4.2
- 3.9, 3.10, 3.11, 3.12, 3.13

Upgrade considerations (v0.10.8)
================================
Expand Down
942 changes: 564 additions & 378 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wagtail-modeltranslation"
version = "0.15.2"
version = "0.16.0"
license = "New BSD"
authors = ["InfoPortugal S.A. <[email protected]>"]
maintainers = ["InfoPortugal S.A. <[email protected]>"]
Expand All @@ -27,6 +27,7 @@ classifiers = [
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Intended Audience :: Developers',
Expand All @@ -35,21 +36,20 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.9"
Django = ">=4.2"
wagtail = ">=5.2,<=7.0"
python = "^3.9" # https://endoflife.date/python
Django = ">=4.2" # https://endoflife.date/django
wagtail = ">=6.3,<8" # https://endoflife.date/wagtail
django-modeltranslation = ">=0.19"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"
bumpversion = "*"
wheel = "*"
twine = "*"
autopep8 = "^1.6.0"

[tool.poetry.group.dev.dependencies]
flake8 = "^5.0.4"


[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion wagtail_modeltranslation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.15.2"
__version__ = "0.16.0"
default_app_config = "wagtail_modeltranslation.apps.WagtailModeltranslationConfig"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from django.utils.translation import activate, get_language
from modeltranslation import settings as mt_settings
from modeltranslation.settings import DEFAULT_LANGUAGE
from six import iteritems
from wagtail.models import Page
from wagtail.templatetags.wagtailcore_tags import pageurl

Expand Down Expand Up @@ -48,7 +47,7 @@ def change_lang(context, lang=None, page=None, *args, **kwargs):
translated_url = "/" + lang + "/" + path_components[0] + "/"
if request.GET:
translated_url += "?"
for count, (key, value) in enumerate(iteritems(request.GET)):
for count, (key, value) in enumerate(request.GET.items()):
if count != 0:
translated_url += "&"
translated_url += key + "=" + value
Expand Down
3 changes: 1 addition & 2 deletions wagtail_modeltranslation/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from django.utils.html import escape, format_html, format_html_join
from django.utils.translation import gettext as _
from django.views.decorators.csrf import csrf_exempt
from six import iteritems

from modeltranslation.utils import build_localized_fieldname
from modeltranslation import settings as mt_settings
Expand Down Expand Up @@ -117,7 +116,7 @@ def return_translation_target_field_rendered_html(request, page_id):
target_field_patched = []
for item in origin_field_serialized:
patched_item = {"name": None, "value": None}
for att in iteritems(item):
for att in item.items():
target_value = att[1]
if att[0] == "name":
target_value = att[1].replace(origin_field_name, target_field_name)
Expand Down
Loading