Source

django-odb / odb / template.py

Full commit
from django.template.loader import BaseLoader
from odb.traverse import get_object
from django.template.base import TemplateDoesNotExist

class TraverseLoader(BaseLoader):
    is_usable = True
    
    def load_template(self, template_name, template_dirs=None):
        template = get_object("/templates/%s" % template_name)
        if template == None:
            raise TemplateDoesNotExist
        return template, None