diff --git a/src/dal_queryset_sequence/fields.py b/src/dal_queryset_sequence/fields.py index 7eb510a94..5639a94dd 100644 --- a/src/dal_queryset_sequence/fields.py +++ b/src/dal_queryset_sequence/fields.py @@ -6,7 +6,7 @@ ) from django import forms -from django.conf.urls import url +from django.urls import re_path as url from django.contrib.contenttypes.models import ContentType from queryset_sequence import QuerySetSequence diff --git a/src/dal_queryset_sequence/widgets.py b/src/dal_queryset_sequence/widgets.py index 49b110cbd..00e3eb38e 100644 --- a/src/dal_queryset_sequence/widgets.py +++ b/src/dal_queryset_sequence/widgets.py @@ -8,7 +8,6 @@ from django import forms from django.contrib.contenttypes.models import ContentType -from django.utils.encoding import force_text class QuerySetSequenceSelectMixin(WidgetMixin): @@ -16,7 +15,7 @@ class QuerySetSequenceSelectMixin(WidgetMixin): def label_from_instance(self, obj): """Convert an object into string. Override it to customize display.""" - return force_text(obj) + return str(obj) def filter_choices_to_render(self, selected_choices): """Overwrite self.choices to exclude unselected values.""" diff --git a/src/dal_select2_queryset_sequence/fields.py b/src/dal_select2_queryset_sequence/fields.py index 8f58cd352..15e7b1f14 100644 --- a/src/dal_select2_queryset_sequence/fields.py +++ b/src/dal_select2_queryset_sequence/fields.py @@ -5,7 +5,7 @@ from dal_select2_queryset_sequence.views import Select2QuerySetSequenceAutoView from dal_select2_queryset_sequence.widgets import QuerySetSequenceSelect2 -from django.conf.urls import url +from django.urls import re_path as url from queryset_sequence import QuerySetSequence diff --git a/test_project/custom_select2/urls.py b/test_project/custom_select2/urls.py index a2cfc0af0..badffe269 100644 --- a/test_project/custom_select2/urls.py +++ b/test_project/custom_select2/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModel diff --git a/test_project/forward_different_fields/urls.py b/test_project/forward_different_fields/urls.py index c6e838575..ec953bf46 100644 --- a/test_project/forward_different_fields/urls.py +++ b/test_project/forward_different_fields/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url class ListWithForwardsView(autocomplete.Select2ListView): diff --git a/test_project/linked_data/urls.py b/test_project/linked_data/urls.py index 24f79ecae..620190b17 100644 --- a/test_project/linked_data/urls.py +++ b/test_project/linked_data/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModel diff --git a/test_project/rename_forward/urls.py b/test_project/rename_forward/urls.py index d57c7e00f..8b839af10 100644 --- a/test_project/rename_forward/urls.py +++ b/test_project/rename_forward/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModel diff --git a/test_project/requirements.txt b/test_project/requirements.txt index 383910fa0..cb043a559 100644 --- a/test_project/requirements.txt +++ b/test_project/requirements.txt @@ -14,7 +14,7 @@ pytest-cov pytest-splinter tenacity whitenoise -django-nested-admin>=3.0.21 +https://github.com/jpic/django-nested-admin/archive/refs/heads/master.zip#egg=django-nested-admin django-debug-toolbar sqlparse>=0.4.2 # not directly required, pinned by Snyk to avoid a vulnerability djhacker diff --git a/test_project/secure_data/urls.py b/test_project/secure_data/urls.py index 4b1b2f81b..e616c1037 100644 --- a/test_project/secure_data/urls.py +++ b/test_project/secure_data/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModel diff --git a/test_project/select2_foreign_key/urls.py b/test_project/select2_foreign_key/urls.py index a2cfc0af0..badffe269 100644 --- a/test_project/select2_foreign_key/urls.py +++ b/test_project/select2_foreign_key/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModel diff --git a/test_project/select2_generic_foreign_key/urls.py b/test_project/select2_generic_foreign_key/urls.py index 9a24951b9..396fd9942 100644 --- a/test_project/select2_generic_foreign_key/urls.py +++ b/test_project/select2_generic_foreign_key/urls.py @@ -1,6 +1,6 @@ # from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url # from django.contrib.auth.models import Group from django.views import generic diff --git a/test_project/select2_generic_m2m/urls.py b/test_project/select2_generic_m2m/urls.py index 09321201a..b33173c8c 100644 --- a/test_project/select2_generic_m2m/urls.py +++ b/test_project/select2_generic_m2m/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from django.contrib.auth.models import Group from django.views import generic diff --git a/test_project/select2_gm2m/urls.py b/test_project/select2_gm2m/urls.py index 7c6c5b16a..6888fb2d9 100644 --- a/test_project/select2_gm2m/urls.py +++ b/test_project/select2_gm2m/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from django.contrib.auth.models import Group from django.views import generic diff --git a/test_project/select2_list/urls.py b/test_project/select2_list/urls.py index 0d33bd256..da9a492a3 100644 --- a/test_project/select2_list/urls.py +++ b/test_project/select2_list/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import re_path as url from .views import Select2ListViewAutocomplete, Select2ProvidedValueListViewAutocomplete diff --git a/test_project/select2_many_to_many/urls.py b/test_project/select2_many_to_many/urls.py index bf47d1299..8e1850445 100644 --- a/test_project/select2_many_to_many/urls.py +++ b/test_project/select2_many_to_many/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from django.views import generic from .forms import TForm diff --git a/test_project/select2_nestedadmin/urls.py b/test_project/select2_nestedadmin/urls.py index 13d02f3e7..76500cfae 100644 --- a/test_project/select2_nestedadmin/urls.py +++ b/test_project/select2_nestedadmin/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from .models import TModelThree diff --git a/test_project/select2_one_to_one/urls.py b/test_project/select2_one_to_one/urls.py index 2fdb27750..94c5e190c 100644 --- a/test_project/select2_one_to_one/urls.py +++ b/test_project/select2_one_to_one/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from django.views import generic from .forms import TForm diff --git a/test_project/select2_outside_admin/urls.py b/test_project/select2_outside_admin/urls.py index 3ac844e55..f8aba24fc 100644 --- a/test_project/select2_outside_admin/urls.py +++ b/test_project/select2_outside_admin/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import re_path as url from .views import UpdateView diff --git a/test_project/select2_tagging/urls.py b/test_project/select2_tagging/urls.py index 588d80155..ff542c65e 100644 --- a/test_project/select2_tagging/urls.py +++ b/test_project/select2_tagging/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from tagging.models import Tag diff --git a/test_project/select2_taggit/urls.py b/test_project/select2_taggit/urls.py index fb3770286..94929fe24 100644 --- a/test_project/select2_taggit/urls.py +++ b/test_project/select2_taggit/urls.py @@ -1,6 +1,6 @@ from dal import autocomplete -from django.conf.urls import url +from django.urls import re_path as url from taggit.models import Tag diff --git a/test_project/tests/test_widgets.py b/test_project/tests/test_widgets.py index 23c97a414..bd906b927 100644 --- a/test_project/tests/test_widgets.py +++ b/test_project/tests/test_widgets.py @@ -9,7 +9,7 @@ from django import forms from django import http from django import test -from django.conf.urls import url +from django.urls import re_path as url try: from django.urls import reverse except ImportError: diff --git a/test_project/urls.py b/test_project/urls.py index f63fc3965..55556468a 100644 --- a/test_project/urls.py +++ b/test_project/urls.py @@ -1,6 +1,6 @@ import django from django.conf import settings -from django.conf.urls import include, url +from django.urls import include, re_path as url from django.contrib import admin import views diff --git a/tox.ini b/tox.ini index 8b4a75554..dc2d22545 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # Note that django doesn't support pypy3 for now # https://code.djangoproject.com/ticket/25849 -envlist = py{34,35,36,37,38,39,py,py3}-dj{32,main} +envlist = py{34,35,36,37,38,39,py,py3}-dj{32,40,main} [testenv] changedir = {toxinidir}/test_project @@ -11,7 +11,7 @@ setenv = DJANGO_SETTINGS_MODULE=settings.base commands = - dj{32,main}: py.test -v --cov --liveserver 127.0.0.1:9999 {posargs} secure_data rename_forward select2_foreign_key select2_generic_foreign_key select2_list select2_many_to_many select2_one_to_one select2_outside_admin select2_taggit custom_select2 select2_nestedadmin select2_djhacker_formfield + py.test -v --cov --liveserver 127.0.0.1:9999 {posargs} secure_data rename_forward select2_foreign_key select2_generic_foreign_key select2_list select2_many_to_many select2_one_to_one select2_outside_admin select2_taggit custom_select2 select2_nestedadmin select2_djhacker_formfield deps = dj18: Django==1.8.* @@ -24,6 +24,7 @@ deps = dj30: Django==3.0.* dj31: Django==3.1.* dj31: Django==3.2.* + dj40: Django==4.0.0-rc1 djmain: https://github.com/django/django/archive/main.tar.gz -rtest_project/requirements.txt