Ticket #949: django.patch

File django.patch, 1.3 KB (added by upadhyay@…, 19 years ago)

takes a comma seperated list as include argument

  • core/template/loader_tags.py

     
    11from django.core.template import TemplateSyntaxError, TemplateDoesNotExist, resolve_variable
    22from django.core.template import Library, Context, Node
    3 from django.core.template.loader import get_template, get_template_from_string, find_template_source
     3from django.core.template.loader import select_template, get_template_from_string, find_template_source
    44from django.conf.settings import TEMPLATE_DEBUG
    55register = Library()
    66
     
    7979class ConstantIncludeNode(Node):
    8080    def __init__(self, template_path):
    8181        try:
    82             t = get_template(template_path)
     82            t = select_template(template_path.split(','))
    8383            self.template = t
    8484        except:
    8585            if TEMPLATE_DEBUG:
     
    9999    def render(self, context):
    100100         try:
    101101             template_name = resolve_variable(self.template_name, context)
    102              t = get_template(template_name)
     102             t = select_template(template_name.split(','))
    103103             return t.render(context)
    104104         except TemplateSyntaxError, e:
    105105             if TEMPLATE_DEBUG:
Back to Top