From b50bc0eeb8a2f40d6234151c00df0fd723d459a1 Mon Sep 17 00:00:00 2001 From: Diego Alejandro Asencio Cuellar Date: Sun, 3 Oct 2021 21:37:48 -0500 Subject: [PATCH] Fix ImportError: cannot import name 'python_2_unicode_compatible'. (Compatibility with django 3) --- jet/dashboard/models.py | 2 +- jet/dashboard/templates/admin/index.html | 2 +- jet/models.py | 2 +- jet/templates/admin/edit_inline/compact.html | 2 +- jet/templates/rangefilter/date_filter.html | 2 +- jet/tests/models.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jet/dashboard/models.py b/jet/dashboard/models.py index cf43c30c..d6a6c435 100644 --- a/jet/dashboard/models.py +++ b/jet/dashboard/models.py @@ -1,7 +1,7 @@ from importlib import import_module import json from django.db import models -from django.utils.encoding import python_2_unicode_compatible +from six import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from jet.utils import LazyDateTimeEncoder diff --git a/jet/dashboard/templates/admin/index.html b/jet/dashboard/templates/admin/index.html index 228ece54..e4fa151a 100644 --- a/jet/dashboard/templates/admin/index.html +++ b/jet/dashboard/templates/admin/index.html @@ -1,5 +1,5 @@ {% extends "admin/base_site.html" %} -{% load i18n admin_static jet_dashboard_tags static %} +{% load i18n jet_dashboard_tags static %} {% block html %}{% get_dashboard 'index' as dashboard %}{{ block.super }}{% endblock %} diff --git a/jet/models.py b/jet/models.py index 8fe97564..254e892e 100644 --- a/jet/models.py +++ b/jet/models.py @@ -1,6 +1,6 @@ from django.db import models from django.utils import timezone -from django.utils.encoding import python_2_unicode_compatible +from six import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ diff --git a/jet/templates/admin/edit_inline/compact.html b/jet/templates/admin/edit_inline/compact.html index dd4232ee..61b4b687 100644 --- a/jet/templates/admin/edit_inline/compact.html +++ b/jet/templates/admin/edit_inline/compact.html @@ -1,4 +1,4 @@ -{% load i18n admin_urls admin_static %} +{% load i18n admin_urls %}

{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

diff --git a/jet/templates/rangefilter/date_filter.html b/jet/templates/rangefilter/date_filter.html index f0e47656..2a2dd9d8 100644 --- a/jet/templates/rangefilter/date_filter.html +++ b/jet/templates/rangefilter/date_filter.html @@ -1,4 +1,4 @@ -{% load i18n admin_static %} +{% load i18n %}

{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}