Browse Source

Used a nontemporal example in QuerySet.bulk_create() in docs.

Tim Graham 8 years ago
parent
commit
e2d02c1fc9
2 changed files with 6 additions and 7 deletions
  1. 2 3
      docs/ref/models/querysets.txt
  2. 4 4
      docs/topics/db/optimization.txt

+ 2 - 3
docs/ref/models/querysets.txt

@@ -1881,9 +1881,8 @@ efficient manner (generally only 1 query, no matter how many objects there
 are)::
 
     >>> Entry.objects.bulk_create([
-    ...     Entry(headline="Django 1.0 Released"),
-    ...     Entry(headline="Django 1.1 Announced"),
-    ...     Entry(headline="Breaking: Django is awesome")
+    ...     Entry(headline='This is a test'),
+    ...     Entry(headline='This is only a test'),
     ... ])
 
 This has a number of caveats though:

+ 4 - 4
docs/topics/db/optimization.txt

@@ -339,14 +339,14 @@ When creating objects, where possible, use the
 number of SQL queries. For example::
 
     Entry.objects.bulk_create([
-        Entry(headline="Python 3.0 Released"),
-        Entry(headline="Python 3.1 Planned")
+        Entry(headline='This is a test'),
+        Entry(headline='This is only a test'),
     ])
 
 ...is preferable to::
 
-    Entry.objects.create(headline="Python 3.0 Released")
-    Entry.objects.create(headline="Python 3.1 Planned")
+    Entry.objects.create(headline='This is a test')
+    Entry.objects.create(headline='This is only a test')
 
 Note that there are a number of :meth:`caveats to this method
 <django.db.models.query.QuerySet.bulk_create>`, so make sure it's appropriate