1 from django.template import TemplateDoesNotExist
2 from django.template.loader import BaseLoader
3 from django.utils.encoding import smart_unicode
5 from philo.models import Template
8 class Loader(BaseLoader):
11 def load_template_source(self, template_name, template_dirs=None):
13 template = Template.objects.get_with_path(template_name)
14 except Template.DoesNotExist:
15 raise TemplateDoesNotExist(template_name)
16 return (template.code, smart_unicode(template))