diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aab608e..47df87f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,8 @@ jobs: django-version: "4.0" - python-version: "3.10" django-version: "4.1" + - python-version: "3.11" + django-version: "4.2" - grappelli: "1" name-suffix: " + grappelli" python-version: "3.7" diff --git a/nested_admin/compat.py b/nested_admin/compat.py index 270b898..da45bdb 100644 --- a/nested_admin/compat.py +++ b/nested_admin/compat.py @@ -4,6 +4,7 @@ See https://github.com/django/django/commit/c19b56f633e172b3c02094cbe12d28865ee57772 and https://code.djangoproject.com/ticket/28377 """ + from collections import defaultdict, OrderedDict import warnings diff --git a/nested_admin/nested.py b/nested_admin/nested.py index 12429d1..5195b0b 100644 --- a/nested_admin/nested.py +++ b/nested_admin/nested.py @@ -193,9 +193,11 @@ def inline_formset_data(self): "lookupAutocomplete": getattr( self.opts, "autocomplete_lookup_fields", {} ), - "formsetFkName": self.formset.fk.name - if getattr(self.formset, "fk", None) - else "", + "formsetFkName": ( + self.formset.fk.name + if getattr(self.formset, "fk", None) + else "" + ), "formsetFkModel": formset_fk_model, "nestingLevel": getattr(self.formset, "nesting_depth", 0), "fieldNames": { @@ -542,7 +544,7 @@ def get_formset(self, request, obj=None, **kwargs): if self.sortable_field_name: - class FormSet(BaseFormSet): + class FormSet(BaseFormSet): # noqa: F811 sortable_field_name = self.sortable_field_name kwargs["formset"] = FormSet diff --git a/nested_admin/polymorphic.py b/nested_admin/polymorphic.py index 311bc3d..10de5b0 100644 --- a/nested_admin/polymorphic.py +++ b/nested_admin/polymorphic.py @@ -152,7 +152,7 @@ def get_formset(self, request, obj=None, **kwargs): if self.sortable_field_name: - class FormSet(BaseFormSet): + class FormSet(BaseFormSet): # noqa: F811 sortable_field_name = self.sortable_field_name kwargs["formset"] = FormSet @@ -190,7 +190,7 @@ def get_formset(self, request, obj=None, **kwargs): if self.sortable_field_name: - class FormSet(BaseFormSet): + class FormSet(BaseFormSet): # noqa: F811 sortable_field_name = self.sortable_field_name kwargs["formset"] = FormSet diff --git a/setup.py b/setup.py index bf92827..bf2e88e 100755 --- a/setup.py +++ b/setup.py @@ -72,10 +72,12 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Framework :: Django", "Framework :: Django :: 3.2", "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", ], include_package_data=True, zip_safe=False, diff --git a/tox.ini b/tox.ini index 4fc5547..c185368 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py{36,37,38,39,310}-dj32-{grp,nogrp} py{38,39,310}-dj40-{grp,nogrp} py{38,39,310}-dj41-nogrp + py{38,39,310,311}-dj42-nogrp black,flake8 skipsdist=True @@ -79,6 +80,7 @@ python = 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 [gh-actions:env] DJANGO = @@ -86,6 +88,7 @@ DJANGO = 3.2: dj32 4.0: dj40 4.1: dj41 + 4.2: dj42 GRAPPELLI = 0: nogrp 1: grp