mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #7596. Added Model.objects.bulk_create, and make use of it in several places. This provides a performance benefit when inserting multiple objects. THanks to Russ for the review, and Simon Meers for the MySQl implementation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
21
tests/regressiontests/bulk_create/models.py
Normal file
21
tests/regressiontests/bulk_create/models.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Country(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
iso_two_letter = models.CharField(max_length=2)
|
||||
|
||||
class Place(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
class Restaurant(Place):
|
||||
pass
|
||||
|
||||
class Pizzeria(Restaurant):
|
||||
pass
|
||||
|
||||
class State(models.Model):
|
||||
two_letter_code = models.CharField(max_length=2, primary_key=True)
|
||||
Reference in New Issue
Block a user