diff options
| author | Tim Graham <timograham@gmail.com> | 2013-08-29 12:09:35 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-08-29 12:11:03 -0400 |
| commit | c7d0ff0cad24dbf444f2e4b534377c3352c7aa98 (patch) | |
| tree | 7bd912d817fbdde2126e7cd01141be1663312de8 /django/db/models/sql/compiler.py | |
| parent | f19a3669b87641d7882491c3590d3c1c79756197 (diff) | |
Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
Diffstat (limited to 'django/db/models/sql/compiler.py')
| -rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 6c8b850c84..5dda379236 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -437,7 +437,7 @@ class SQLCompiler(object): # Firstly, avoid infinite loops. if not already_seen: already_seen = set() - join_tuple = tuple([self.query.alias_map[j].table_name for j in joins]) + join_tuple = tuple(self.query.alias_map[j].table_name for j in joins) if join_tuple in already_seen: raise FieldError('Infinite loop caused by ordering.') already_seen.add(join_tuple) @@ -866,7 +866,7 @@ class SQLInsertCompiler(SQLCompiler): return [(" ".join(result), tuple(params))] if can_bulk: result.append(self.connection.ops.bulk_insert_sql(fields, len(values))) - return [(" ".join(result), tuple([v for val in values for v in val]))] + return [(" ".join(result), tuple(v for val in values for v in val))] else: return [ (" ".join(result + ["VALUES (%s)" % ", ".join(p)]), vals) |
