Author: leidel
Date: Sat Nov 15 18:02:30 2008
New Revision: 76
Modified:
trunk/dbtemplates/cache.py
Log:
Fixed problem when django.contrib.sites' table isn't populated yet on
initialization of dbtemplates. Thanks for the report, Kevin Fricovsky
Modified: trunk/dbtemplates/cache.py
==============================================================================
--- trunk/dbtemplates/cache.py (original)
+++ trunk/dbtemplates/cache.py Sat Nov 15 18:02:30 2008
@@ -1,7 +1,6 @@
import os
from django.conf import settings
from django.core.cache import cache
-from django.contrib.sites.models import Site
from django.template import TemplateDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import smart_unicode, force_unicode
@@ -13,8 +12,10 @@
Set DBTEMPLATES_CACHE_BACKEND setting to the Python path to that
subclass.
"""
- def __init__(self):
- self.site = Site.objects.get_current()
+ def _site(self):
+ from django.contrib.sites.models import Site
+ return Site.objects.get_current()
+ site = property(_site)
def load(self, name):
"""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---