Ticket #25150: fix_django_iterator.patch

File fix_django_iterator.patch, 762 bytes (added by Eldon Koyle, 9 years ago)
  • django/db/models/sql/query.py

    diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
    index ba6a50a..7b3a3cc 100644
    a b class Query(object):  
    11681168                parts, opts, alias, can_reuse=can_reuse, allow_many=allow_many)
    11691169
    11701170            # Prevent iterator from being consumed by check_related_objects()
     1171            _value = value
    11711172            if isinstance(value, Iterator):
    1172                 value = list(value)
    1173             self.check_related_objects(field, value, opts)
     1173                _value = list(value)
     1174            self.check_related_objects(field, _value, opts)
    11741175
    11751176            # split_exclude() needs to know which joins were generated for the
    11761177            # lookup parts
Back to Top