summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2006-11-07 04:13:06 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2006-11-07 04:13:06 +0000
commit4cb22473278df29c998a75fb1646dc821c75e0cc (patch)
tree27fb3a35e8cf1d537f321a47f1b384baf5cc98ce
parenta888249770cec8be42d33b51ef455826851688ee (diff)
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
-rw-r--r--django/template/__init__.py7
1 files 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))