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