#15948: Regarding find_template_source()
----------------------------------+---------------------------------
Reporter: Kronuz | Owner: nobody
Type: Cleanup/optimization | Status: new
Milestone: | Component: Template system
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
----------------------------------+---------------------------------
I still find myself in need of getting a template source, the current
find_template returns a compiled template for the most part, and I would
suggest keeping a working find_template_source for these edge cases as
mine. Perhaps something like this is in place:
{{{
def find_template_source(name, dirs=None):
if template_source_loaders is None:
loaders = []
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
def load_template_source(loaders):
for loader in loaders:
if hasattr(loader, 'loaders'):
try:
return load_template_source(loader.loaders)
except TemplateDoesNotExist:
pass
else:
try:
source, display_name =
loader.load_template_source(name, dirs)
return (source, make_origin(display_name, loader,
name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
return load_template_source(template_source_loaders)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15948>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.