From a11a029499d7da3f4ea79d03e115565c0a14eb64 Mon Sep 17 00:00:00 2001 From: Sanshain <40761960+Sanshain@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:43:29 +0300 Subject: [PATCH 1/3] set the stub for `python_2_unicode_compatible` set the stub for `python_2_unicode_compatible` function to fix error `NameError: name 'python_2_unicode_compatible' is not defined` for django versions 3.0 and later ` --- jet/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jet/models.py b/jet/models.py index 8fe97564..ed1390e3 100644 --- a/jet/models.py +++ b/jet/models.py @@ -1,9 +1,14 @@ from django.db import models from django.utils import timezone -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ +import sys +if sys.version_info.major == 2: + from django.utils.encoding import python_2_unicode_compatible +else: + python_2_unicode_compatible = lambda cls: cls + @python_2_unicode_compatible class Bookmark(models.Model): url = models.URLField(verbose_name=_('URL')) From 4168231b8640dca1f7d9a8a6d558a8b5e9c5da88 Mon Sep 17 00:00:00 2001 From: Sanshain <40761960+Sanshain@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:44:33 +0300 Subject: [PATCH 2/3] Update setup.py --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 1cf51df6..09411d59 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,8 @@ def get_install_requires(): 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Environment :: Web Environment', 'Topic :: Software Development', 'Topic :: Software Development :: User Interfaces', From 462228d6675add67e2c4b2adab581cfd933e112d Mon Sep 17 00:00:00 2001 From: Sanshain <40761960+Sanshain@users.noreply.github.com> Date: Tue, 22 Jun 2021 15:19:54 +0300 Subject: [PATCH 3/3] set for `python_2_unicode_compatible` in dashboard --- jet/dashboard/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jet/dashboard/models.py b/jet/dashboard/models.py index cf43c30c..86211322 100644 --- a/jet/dashboard/models.py +++ b/jet/dashboard/models.py @@ -1,10 +1,16 @@ from importlib import import_module import json from django.db import models -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from jet.utils import LazyDateTimeEncoder +import sys + +if sys.version_info.major == 2: + from django.utils.encoding import python_2_unicode_compatible +else: + python_2_unicode_compatible = lambda cls: cls + @python_2_unicode_compatible class UserDashboardModule(models.Model):