mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-03-16 22:20:28 +00:00
Use better version checks, fix #78
This commit is contained in:
parent
279fba2635
commit
f0cfdfa9ce
3 changed files with 6 additions and 6 deletions
|
|
@ -7,13 +7,13 @@ from dbtemplates.models import Template
|
|||
from dbtemplates.utils.cache import (cache, get_cache_key,
|
||||
set_and_return, get_cache_notfound_key)
|
||||
|
||||
if django.get_version() >= '1.8':
|
||||
from django.template.loaders.base import Loader as tLoaderCls
|
||||
if django.VERSION[:2] >= (1, 8):
|
||||
from django.template.loaders.base import Loader as BaseLoader
|
||||
else:
|
||||
from django.template.loader import BaseLoader as tLoaderCls # noqa
|
||||
from django.template.loader import BaseLoader # noqa
|
||||
|
||||
|
||||
class Loader(tLoaderCls):
|
||||
class Loader(BaseLoader):
|
||||
"""
|
||||
A custom template loader to load templates from the database.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Migration(migrations.Migration):
|
|||
('sites', '0001_initial'),
|
||||
]
|
||||
|
||||
if django.get_version() >= '1.8':
|
||||
if django.VERSION[:2] >= (1, 8):
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Template',
|
||||
|
|
|
|||
|
|
@ -37,5 +37,5 @@ TEMPLATE_LOADERS = (
|
|||
'dbtemplates.loader.Loader',
|
||||
)
|
||||
|
||||
if django.get_version() <= '1.6':
|
||||
if django.VERSION[:2] <= (1, 6):
|
||||
TEST_RUNNER = 'discover_runner.DiscoverRunner'
|
||||
|
|
|
|||
Loading…
Reference in a new issue