From 4cb22473278df29c998a75fb1646dc821c75e0cc Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 7 Nov 2006 04:13:06 +0000 Subject: [PATCH] Fixed #2343: Library.inclusion_tag now accepts a list of template names along with a single name. Thanks, mderk@yandex.ru git-svn-id: http://code.djangoproject.com/svn/django/trunk@4038 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/template/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/django/template/__init__.py b/django/template/__init__.py index 4e0bcf384e..5affafeba9 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -868,8 +868,11 @@ class Library(object): dict = func(*args) if not getattr(self, 'nodelist', False): - from django.template.loader import get_template - t = get_template(file_name) + from django.template.loader import get_template, select_template + if hasattr(file_name, '__iter__'): + t = select_template(file_name) + else: + t = get_template(file_name) self.nodelist = t.nodelist return self.nodelist.render(context_class(dict))