Ticket #13745: template_extends_select_multi.diff

File template_extends_select_multi.diff, 952 bytes (added by gauss, 5 years ago)
  • django/template/loader_tags.py

     
    11from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable
    22from django.template import Library, Node, TextNode
    3 from django.template.loader import get_template
     3from django.template.loader import get_template, select_template
    44from django.conf import settings
    55from django.utils.safestring import mark_safe
    66
     
    9797            raise TemplateSyntaxError(error_msg)
    9898        if hasattr(parent, 'render'):
    9999            return parent # parent is a Template object
    100         return get_template(parent)
     100        return select_template(parent) if isinstance(parent, (list, tuple)) else get_template(parent)
     101   
    101102
    102103    def render(self, context):
    103104        compiled_parent = self.get_parent(context)
Back to Top