Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2102 -- Template system 'for' loops now support generators. Th…

…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...
commit 6b730e1e92eb85beb3d3f7401ee5dce50895d758 1 parent 136752c
Adrian Holovaty authored June 20, 2006

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  django/template/defaulttags.py
2  django/template/defaulttags.py
@@ -88,6 +88,8 @@ def render(self, context):
88 88
             values = []
89 89
         if values is None:
90 90
             values = []
  91
+        if not hasattr(values, '__len__'):
  92
+            values = list(values)
91 93
         len_values = len(values)
92 94
         if self.reversed:
93 95
             # From http://www.python.org/doc/current/tut/node11.html

0 notes on commit 6b730e1

Please sign in to comment.
Something went wrong with that request. Please try again.