Added/tweaked docs for exceptions, middleware, and signals. Minor formatting tweaks...
[philo.git] / philo / loaders / database.py
1 from django.template import TemplateDoesNotExist
2 from django.template.loader import BaseLoader
3 from django.utils.encoding import smart_unicode
4
5 from philo.models import Template
6
7
8 class Loader(BaseLoader):
9         is_usable=True
10         
11         def load_template_source(self, template_name, template_dirs=None):
12                 try:
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))