1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.6.x] Fixed #21566 -- Fixed AttributeError when using bulk_create with ForeignObject.

Backport of bbc73e6a12 from master.
This commit is contained in:
Roger Hu
2013-12-06 01:14:57 +00:00
committed by Tim Graham
parent 32a880ae95
commit 9a446211bd
2 changed files with 9 additions and 2 deletions

View File

@@ -342,7 +342,7 @@ class QuerySet(object):
return objs
self._for_write = True
connection = connections[self.db]
fields = self.model._meta.local_fields
fields = self.model._meta.local_concrete_fields
with transaction.commit_on_success_unless_managed(using=self.db):
if (connection.features.can_combine_inserts_with_and_without_auto_increment_pk
and self.model._meta.has_auto_field):