diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-04-29 04:22:05 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-09-02 19:17:15 +0300 |
| commit | 23268608512444de626e63dee1815fb5b5207a48 (patch) | |
| tree | 870e7f4ff110ef728bd2d5c32f197d7058332bc0 /tests/regressiontests/bulk_create/models.py | |
| parent | f0c469c7be1b8eb1326bb8ab263bdcdd1e8fa47e (diff) | |
[1.4.x] Fixed #17788 -- Added batch_size argument to qs.bulk_create()
The qs.bulk_create() method did not work with large batches together
with SQLite3. This commit adds a way to split the bulk into smaller
batches. The default batch size is unlimited except for SQLite3 where
the batch size is limited to 999 SQL parameters per batch.
Thanks to everybody who participated in the discussions at Trac.
Backpatch of 29132ebdef0e0b9c09e456b05f0e6a22f1106a4f from master (with
documentation changes removed).
Diffstat (limited to 'tests/regressiontests/bulk_create/models.py')
| -rw-r--r-- | tests/regressiontests/bulk_create/models.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/regressiontests/bulk_create/models.py b/tests/regressiontests/bulk_create/models.py index a4c611d537..bc685bbbe4 100644 --- a/tests/regressiontests/bulk_create/models.py +++ b/tests/regressiontests/bulk_create/models.py @@ -18,4 +18,8 @@ class Pizzeria(Restaurant): pass class State(models.Model): - two_letter_code = models.CharField(max_length=2, primary_key=True)
\ No newline at end of file + two_letter_code = models.CharField(max_length=2, primary_key=True) + +class TwoFields(models.Model): + f1 = models.IntegerField(unique=True) + f2 = models.IntegerField(unique=True) |
