Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #23296 -- Fixed RunPython code sample in Migration Operations.

  • Loading branch information...
commit 7ca665c5f593953cba2cfeebd4f82acd38231031 1 parent 1d79d08
@areski areski authored timgraham committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 docs/ref/migration-operations.txt
View
6 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):
Please sign in to comment.
Something went wrong with that request. Please try again.