mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Used a nontemporal example in QuerySet.bulk_create() in docs.
This commit is contained in:
		| @@ -1881,9 +1881,8 @@ efficient manner (generally only 1 query, no matter how many objects there | |||||||
| are):: | are):: | ||||||
|  |  | ||||||
|     >>> Entry.objects.bulk_create([ |     >>> Entry.objects.bulk_create([ | ||||||
|     ...     Entry(headline="Django 1.0 Released"), |     ...     Entry(headline='This is a test'), | ||||||
|     ...     Entry(headline="Django 1.1 Announced"), |     ...     Entry(headline='This is only a test'), | ||||||
|     ...     Entry(headline="Breaking: Django is awesome") |  | ||||||
|     ... ]) |     ... ]) | ||||||
|  |  | ||||||
| This has a number of caveats though: | This has a number of caveats though: | ||||||
|   | |||||||
| @@ -339,14 +339,14 @@ When creating objects, where possible, use the | |||||||
| number of SQL queries. For example:: | number of SQL queries. For example:: | ||||||
|  |  | ||||||
|     Entry.objects.bulk_create([ |     Entry.objects.bulk_create([ | ||||||
|         Entry(headline="Python 3.0 Released"), |         Entry(headline='This is a test'), | ||||||
|         Entry(headline="Python 3.1 Planned") |         Entry(headline='This is only a test'), | ||||||
|     ]) |     ]) | ||||||
|  |  | ||||||
| ...is preferable to:: | ...is preferable to:: | ||||||
|  |  | ||||||
|     Entry.objects.create(headline="Python 3.0 Released") |     Entry.objects.create(headline='This is a test') | ||||||
|     Entry.objects.create(headline="Python 3.1 Planned") |     Entry.objects.create(headline='This is only a test') | ||||||
|  |  | ||||||
| Note that there are a number of :meth:`caveats to this method | 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 | <django.db.models.query.QuerySet.bulk_create>`, so make sure it's appropriate | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user