Skip to content

Commit

Permalink
Add official support for Django 5.0 (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
softquantum authored Dec 21, 2023
1 parent 99d93e5 commit 8584e4c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5"
]
dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"Django>=3.2,<5.0",
"Django>=3.2,<5.1",
"Wagtail>=4.1",
"polib>=1.1,<2.0",
"typing_extensions>=4.0"
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ envlist =
python{3.8,3.9,3.10}-django{3.2,4.1}-wagtail{4.1}-{sqlite,postgres12}
python{3.8,3.9,3.10,3.11}-django{4.2}-wagtail{5.1,5.2}-{sqlite,postgres15}
python{3.12}-django{4.2}-wagtail{5.2}-{sqlite,postgres15}
python{3.10,3.11,3.12}-django{5.0}-wagtail{5.2.2}-{sqlite,postgres15}

[gh-actions]
python =
Expand Down Expand Up @@ -35,6 +36,7 @@ deps =
django3.2: Django>=3.2,<3.3
django4.1: Django>=4.1,<4.2
django4.2: Django>=4.2,<5.0
django5.0: Django>=5.0,<5.1

wagtail4.1: wagtail>=4.1,<4.2
wagtail5.1: wagtail>=5.1,<5.2
Expand Down
7 changes: 6 additions & 1 deletion wagtail_localize/modeladmin/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django import VERSION as DJANGO_VERSION
from django.apps import apps
from django.conf import settings
from django.contrib.admin.utils import unquote
Expand Down Expand Up @@ -78,7 +79,11 @@ def get_filters(self, request):
filters = super().get_filters(request)
# Update the 'lookup_params' part of the filters tuple to filter objects
# using the currently active locale
filters[2]["locale"] = self.locale.id
if DJANGO_VERSION >= (5, 0):
# modeladmin IndexView needs an iterable in build_q_object_from_lookup_parameters
filters[2]["locale"] = [self.locale.id]
else:
filters[2]["locale"] = self.locale.id
return filters

def get_context_data(self, **kwargs):
Expand Down

0 comments on commit 8584e4c

Please sign in to comment.