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
This commit is contained in:
Jacob Kaplan-Moss 2006-11-07 04:13:06 +00:00
parent a888249770
commit 4cb2247327
1 changed files with 5 additions and 2 deletions

View File

@ -868,7 +868,10 @@ class Library(object):
dict = func(*args)
if not getattr(self, 'nodelist', False):
from django.template.loader import get_template
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))