From 0379c8cf39f93a53ea7cd93b0dcbc59418d7677a Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 8 Jul 2011 14:46:41 +0200 Subject: [PATCH 1/4] Fixed cache loading. Fixes #13. --- dbtemplates/tests.py | 5 +++++ dbtemplates/utils/cache.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dbtemplates/tests.py b/dbtemplates/tests.py index 32a03ee..8e0d7c2 100644 --- a/dbtemplates/tests.py +++ b/dbtemplates/tests.py @@ -4,6 +4,7 @@ import os import shutil import tempfile +from django.core.cache.backends.base import BaseCache from django.core.management import call_command from django.template import loader, Context from django.test import TestCase @@ -12,6 +13,7 @@ from django.contrib.sites.models import Site from dbtemplates.conf import settings from dbtemplates.models import Template +from dbtemplates.utils.cache import get_cache_backend from dbtemplates.utils.template import get_template_source from dbtemplates.management.commands.sync_templates import (FILES_TO_DATABASE, DATABASE_TO_FILES) @@ -91,3 +93,6 @@ class DbTemplatesTestCase(TestCase): temp_template.close() settings.TEMPLATE_DIRS = old_template_dirs shutil.rmtree(temp_template_dir) + + def test_get_cache(self): + self.assertTrue(isinstance(get_cache_backend(), BaseCache)) diff --git a/dbtemplates/utils/cache.py b/dbtemplates/utils/cache.py index 611a490..65ac768 100644 --- a/dbtemplates/utils/cache.py +++ b/dbtemplates/utils/cache.py @@ -6,7 +6,7 @@ from dbtemplates.conf import settings def get_cache_backend(): - return get_cache(settings.CACHE_BACKEND) + return get_cache(settings.DBTEMPLATES_CACHE_BACKEND) cache = get_cache_backend() From 692a77725d43567cf0ba45b98d03b19aea8b86be Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 8 Jul 2011 14:52:58 +0200 Subject: [PATCH 2/4] Added links to the repo on Github. Fixes #10. --- README.rst | 4 ++++ docs/index.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.rst b/README.rst index f817195..3dd74ec 100644 --- a/README.rst +++ b/README.rst @@ -12,4 +12,8 @@ command, integrates with Django's caching system and the admin actions. Please see http://django-dbtemplates.readthedocs.org/ for more details. +The source code and issue tracker can be found on Github: + +https://github.com/jezdez/django-dbtemplates + .. _template loader: http://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index 06c5bb7..2b1336c 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -11,6 +11,10 @@ It also features optional support for :ref:`versioned storage ` and :ref:`django-admin command `, integrates with Django's :ref:`caching system ` and the :ref:`admin actions `. +Please see http://django-dbtemplates.readthedocs.org/ for more details. + +The source code and issue tracker can be found on Github: https://github.com/jezdez/django-dbtemplates + .. _template loader: http://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates Contents: From 7449de74830aea3045388cb9e289b4bd0401ed00 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 8 Jul 2011 14:56:24 +0200 Subject: [PATCH 3/4] Extended docs about using the Loader class instead of the previously available function. Fixes #11. --- docs/changelog.txt | 19 +++++++++++++++++-- docs/overview.txt | 4 ++-- runtests.py | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 7cd4a85..5a78419 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,13 +1,28 @@ Changelog ========= +1.1.1 (07-08-11) +---------------- + +* Fixed bug in cache loading (again). + +* Fixed bugs in the documentation. + +.. note:: + + Since ``dbtemplates`` removed support for Django lower than 1.2 you + have to use the template loader class in the ``TEMPLATE_LOADERS`` + (``'dbtemplates.loader.Loader'``) and **not** the previosly included + function that ended with ``load_template_source``. + 1.1 (07-06-11) -------------- * **BACKWARDS-INCOMPATIBLE** Requires Django 1.2 or higher. - For previous Django versions use an older versions of dbtemplates, e.g.:: + For previous Django versions use an older versions of ``dbtemplates``, + e.g.:: - $ pip install django-dbtemplates<1.1 + $ pip install "django-dbtemplates<1.1" * Added South migrations. diff --git a/docs/overview.txt b/docs/overview.txt index 2465a3c..c1229f4 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -30,8 +30,8 @@ Setup It should look something like this:: TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', 'dbtemplates.loader.Loader', ) diff --git a/runtests.py b/runtests.py index e0d6ef6..68b0b6c 100644 --- a/runtests.py +++ b/runtests.py @@ -16,8 +16,8 @@ if not settings.configured: 'dbtemplates', ], TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', 'dbtemplates.loader.Loader', ) ) From 88f6c54c83505f5cbd723c842fad20269941bd70 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 8 Jul 2011 15:00:28 +0200 Subject: [PATCH 4/4] Bumped version up a bit. --- dbtemplates/__init__.py | 2 +- docs/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbtemplates/__init__.py b/dbtemplates/__init__.py index 3d7f135..fcc819f 100644 --- a/dbtemplates/__init__.py +++ b/dbtemplates/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 1, 0, "f", 0) # following PEP 386 +VERSION = (1, 1, 1, "f", 0) # following PEP 386 DEV_N = None diff --git a/docs/conf.py b/docs/conf.py index 4b4c5c5..9aa6f16 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ copyright = u'2007-2011, Jannis Leidel' # The short X.Y version. version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.1' +release = '1.1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.