Skip to content

Commit

Permalink
[py3] Fixed outdated map() call in GIS sql compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Sep 23, 2012
1 parent 98b6ce6 commit 799786a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion django/contrib/gis/db/models/sql/compiler.py
@@ -1,3 +1,8 @@
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest

from django.utils.six.moves import zip from django.utils.six.moves import zip


from django.db.backends.util import truncate_name, typecast_timestamp from django.db.backends.util import truncate_name, typecast_timestamp
Expand Down Expand Up @@ -190,7 +195,7 @@ def resolve_columns(self, row, fields=()):
if self.connection.ops.oracle or getattr(self.query, 'geo_values', False): if self.connection.ops.oracle or getattr(self.query, 'geo_values', False):
# We resolve the rest of the columns if we're on Oracle or if # We resolve the rest of the columns if we're on Oracle or if
# the `geo_values` attribute is defined. # the `geo_values` attribute is defined.
for value, field in map(None, row[index_start:], fields): for value, field in zip_longest(row[index_start:], fields):
values.append(self.query.convert_values(value, field, self.connection)) values.append(self.query.convert_values(value, field, self.connection))
else: else:
values.extend(row[index_start:]) values.extend(row[index_start:])
Expand Down

0 comments on commit 799786a

Please sign in to comment.