mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
magic-removal: Merged to [2681]
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2682 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4b3272fae8
commit
13e0d03b13
@ -78,7 +78,7 @@ def get_template(template_name):
|
|||||||
"""
|
"""
|
||||||
return get_template_from_string(*find_template_source(template_name))
|
return get_template_from_string(*find_template_source(template_name))
|
||||||
|
|
||||||
def get_template_from_string(source, origin=None ):
|
def get_template_from_string(source, origin=None):
|
||||||
"""
|
"""
|
||||||
Returns a compiled Template object for the given template code,
|
Returns a compiled Template object for the given template code,
|
||||||
handling template inheritance recursively.
|
handling template inheritance recursively.
|
||||||
|
@ -51,9 +51,11 @@ class ExtendsNode(Node):
|
|||||||
error_msg += " Got this from the %r variable." % self.parent_name_expr #TODO nice repr.
|
error_msg += " Got this from the %r variable." % self.parent_name_expr #TODO nice repr.
|
||||||
raise TemplateSyntaxError, error_msg
|
raise TemplateSyntaxError, error_msg
|
||||||
try:
|
try:
|
||||||
return get_template_from_string(*find_template_source(parent, self.template_dirs))
|
source, origin = find_template_source(parent, self.template_dirs)
|
||||||
except TemplateDoesNotExist:
|
except TemplateDoesNotExist:
|
||||||
raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent
|
raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent
|
||||||
|
else:
|
||||||
|
return get_template_from_string(source, origin)
|
||||||
|
|
||||||
def render(self, context):
|
def render(self, context):
|
||||||
compiled_parent = self.get_parent(context)
|
compiled_parent = self.get_parent(context)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user