Hi,

I have a question for somebody more experienced with the Django
template system internals.

The template loader load_template method is documented as such:

"The load_template() method of the Loader class retrieves the template
string by calling load_template_source(), instantiates a Template from
the template source, and returns a tuple: (template,
template_origin)."

The BaseTemplateLoader differs from this behavior. It looks like it
was purposefully written to hide the template origin. Instead it
returns None, unless TEMPLATE_DEBUG is true, then it return the name
of the template.

The CachedTemplateLoader differs slightly from this, returning the
origin object, rather than the template name, but again only when
TEMPLATE_DEBUG is True.

Is there a reason the template origin isn't always returned?

Knowing the template origin is nice in certain cases, and removing the
special logic would make these two tickets easy to implement:

https://code.djangoproject.com/ticket/16096
https://code.djangoproject.com/ticket/17199

Thanks.

Preston

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en.

Reply via email to