Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e2d02c1f
Kaydet (Commit)
e2d02c1f
authored
Ara 27, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used a nontemporal example in QuerySet.bulk_create() in docs.
üst
4a51ba22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
querysets.txt
docs/ref/models/querysets.txt
+2
-3
optimization.txt
docs/topics/db/optimization.txt
+4
-4
No files found.
docs/ref/models/querysets.txt
Dosyayı görüntüle @
e2d02c1f
...
...
@@ -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:
...
...
docs/topics/db/optimization.txt
Dosyayı görüntüle @
e2d02c1f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment