Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/d/j/django-dbtemplates-1.3/dbtemplates/loader.py   django-dbtemplates(Download)
 
from dbtemplates.models import Template
from dbtemplates.utils.cache import (cache, get_cache_key,
                                     set_and_return, get_cache_notfound_key)
from django.template.loader import BaseLoader
    def load_and_store_template(self, template_name, cache_key, site, **params):
        template = Template.objects.get(name__exact=template_name, **params)
        db = router.db_for_read(Template, instance=template)
        display_name = 'dbtemplates:%s:%s:%s' % (db, template_name, site.domain)
        return set_and_return(cache_key, template.content, display_name)