Fixed #2102 -- Template system 'for' loops now support generators. Thanks, dbm-django@mclachlan.com.au
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3165 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
136752ca9a
commit
6b730e1e92
|
@ -88,6 +88,8 @@ class ForNode(Node):
|
|||
values = []
|
||||
if values is None:
|
||||
values = []
|
||||
if not hasattr(values, '__len__'):
|
||||
values = list(values)
|
||||
len_values = len(values)
|
||||
if self.reversed:
|
||||
# From http://www.python.org/doc/current/tut/node11.html
|
||||
|
|
Loading…
Reference in New Issue