mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +00:00
Imported zip from future_builtins instead of itertools.izip.
In Python 3, itertools.izip is not available any more (behaviour integrated in standard zip).
This commit is contained in:
parent
ecdd0914b1
commit
1aae1cba99
4 changed files with 14 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
from itertools import izip
|
||||
from future_builtins import zip
|
||||
|
||||
from django.core.exceptions import FieldError
|
||||
from django.db import transaction
|
||||
|
@ -882,7 +882,7 @@ class SQLInsertCompiler(SQLCompiler):
|
|||
placeholders = [["%s"] * len(fields)]
|
||||
else:
|
||||
placeholders = [
|
||||
[self.placeholder(field, v) for field, v in izip(fields, val)]
|
||||
[self.placeholder(field, v) for field, v in zip(fields, val)]
|
||||
for val in values
|
||||
]
|
||||
if self.return_id and self.connection.features.can_return_id_from_insert:
|
||||
|
@ -899,7 +899,7 @@ class SQLInsertCompiler(SQLCompiler):
|
|||
else:
|
||||
return [
|
||||
(" ".join(result + ["VALUES (%s)" % ", ".join(p)]), vals)
|
||||
for p, vals in izip(placeholders, params)
|
||||
for p, vals in zip(placeholders, params)
|
||||
]
|
||||
|
||||
def execute_sql(self, return_id=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue