Fix iteration on querysets.
If iteration of a queryset was interrupted (by a break, or a caught error), the next iterator would start from the second element as the cursor had already moved to the first. This is fixed by adding a rewind into the __iter__ method.
This commit is contained in:
@@ -1342,6 +1342,7 @@ class QuerySet(object):
|
||||
raise OperationError(u'Update failed [%s]' % unicode(e))
|
||||
|
||||
def __iter__(self):
|
||||
self.rewind()
|
||||
return self
|
||||
|
||||
def _sub_js_fields(self, code):
|
||||
|
Reference in New Issue
Block a user