fix for templates which have (multiple) directories in their name

git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@25 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: arne@rcs4u.de <arne@rcs4u.de@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 71ab553013820fadcb623a2039d0c51a7ff7f271
This commit is contained in:
arne@rcs4u.de 2008-04-17 12:52:57 +00:00
parent 06dfbb4402
commit b0e61f5ba6

View file

@ -41,7 +41,13 @@ def load_template_source(template_name, template_dirs=None):
f.write(t.content)
f.close()
except IOError:
pass
try:
head, tail = os.path.split(filepath)
if head and not os.path.isdir(head):
os.makedirs(head)
except Exception:
pass
return (t.content, 'db:%s:%s' % (settings.DATABASE_ENGINE, template_name))
except:
pass
@ -57,7 +63,7 @@ load_template_source.is_usable = True
def remove_cached_template(instance):
"""
Called via django's signals to remove cached templates, if the template in the
database was changed.
database was changed or deleted.
"""
if cache_dir is not None:
try: