From 7ca665c5f593953cba2cfeebd4f82acd38231031 Mon Sep 17 00:00:00 2001 From: areski Date: Fri, 15 Aug 2014 19:29:01 +0200 Subject: [PATCH] Fixed #23296 -- Fixed RunPython code sample in Migration Operations. --- docs/ref/migration-operations.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 99b4a61c86..171ddd8ee7 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -219,8 +219,10 @@ model:: # if we directly import it, it'll be the wrong version Country = apps.get_model("myapp", "Country") db_alias = schema_editor.connection.alias - Country.objects.create(name="USA", code="us", using=db_alias) - Country.objects.create(name="France", code="fr", using=db_alias) + Country.objects.using(db_alias).bulk_create([ + Country(name="USA", code="us"), + Country(name="France", code="fr"), + ]) class Migration(migrations.Migration):