Skip to content

Commit

Permalink
Fixed #2102 -- Template system 'for' loops now support generators. Th…
Browse files Browse the repository at this point in the history
…anks, dbm-django@mclachlan.com.au

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3165 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jun 20, 2006
1 parent 136752c commit 6b730e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django/template/defaulttags.py
Expand Up @@ -88,6 +88,8 @@ def render(self, context):
values = [] values = []
if values is None: if values is None:
values = [] values = []
if not hasattr(values, '__len__'):
values = list(values)
len_values = len(values) len_values = len(values)
if self.reversed: if self.reversed:
# From http://www.python.org/doc/current/tut/node11.html # From http://www.python.org/doc/current/tut/node11.html
Expand Down

0 comments on commit 6b730e1

Please sign in to comment.