Skip to content

Commit 68ac54a

Browse files
authored
Django 3.0.4 (jazzband#107)
Co-authored-by: Kaustubh Bhalerao <[email protected]>
1 parent 7ea4655 commit 68ac54a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

dbtemplates/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from django.core.exceptions import ImproperlyConfigured
44
from django.conf import settings
5-
from django.utils.six import string_types
5+
from six import string_types
66

77
from appconf import AppConf
88

dbtemplates/management/commands/sync_templates.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from django.core.management.base import CommandError, BaseCommand
66
from django.template.utils import get_app_template_dirs
77
from django.template.loader import _engine_list
8+
try:
9+
from six import input
10+
except ImportError:
11+
pass
812

913
from dbtemplates.models import Template
1014

11-
# (propably obsolete) backwards compatability as django already threw out six
12-
if sys.version_info[0] == 2:
13-
input = raw_input # noqa: F821
14-
1515
ALWAYS_ASK, FILES_TO_DATABASE, DATABASE_TO_FILES = ('0', '1', '2')
1616

1717
DIRS = []

dbtemplates/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.db import models
99
from django.db.models import signals
1010
from django.template import TemplateDoesNotExist
11-
from django.utils.six import python_2_unicode_compatible
11+
from six import python_2_unicode_compatible
1212
from django.utils.translation import ugettext_lazy as _
1313
from django.utils.timezone import now
1414

dbtemplates/test_cases.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
class DbTemplatesTestCase(TestCase):
2424
def setUp(self):
25-
self.old_template_loaders = settings.TEMPLATE_LOADERS
26-
if 'dbtemplates.loader.Loader' not in settings.TEMPLATE_LOADERS:
25+
self.old_TEMPLATES = settings.TEMPLATES
26+
if 'dbtemplates.loader.Loader' not in settings.TEMPLATES:
2727
loader.template_source_loaders = None
28-
settings.TEMPLATE_LOADERS = list(settings.TEMPLATE_LOADERS) + [
28+
settings.TEMPLATES = list(settings.TEMPLATES) + [
2929
'dbtemplates.loader.Loader'
3030
]
3131

@@ -41,7 +41,7 @@ def setUp(self):
4141

4242
def tearDown(self):
4343
loader.template_source_loaders = None
44-
settings.TEMPLATE_LOADERS = self.old_template_loaders
44+
settings.TEMPLATES = self.old_TEMPLATES
4545

4646
def test_basics(self):
4747
self.assertEqual(list(self.t1.sites.all()), [self.site1])

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def find_version(*parts):
5858
'Programming Language :: Python :: 3.7',
5959
'Framework :: Django',
6060
],
61-
install_requires=['django-appconf >= 0.4'],
61+
install_requires=['django-appconf >= 0.4', 'six'],
6262
)

0 commit comments

Comments
 (0)