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
36c35aba
Kaydet (Commit)
36c35aba
authored
May 26, 2018
tarafından
Jeremy Lainé
Kaydeden (comit)
Tim Graham
Haz 08, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[2.1.x] Fixed #29440 -- Doc'd where the bulk argument applies in RelatedManager.
Backport of
74179296
from master
üst
9f67a205
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
relations.txt
docs/ref/models/relations.txt
+13
-3
No files found.
docs/ref/models/relations.txt
Dosyayı görüntüle @
36c35aba
...
@@ -96,7 +96,7 @@ Related objects reference
...
@@ -96,7 +96,7 @@ Related objects reference
parameter ``blog`` to ``create()``. Django figures out that the new
parameter ``blog`` to ``create()``. Django figures out that the new
``Entry`` object's ``blog`` field should be set to ``b``.
``Entry`` object's ``blog`` field should be set to ``b``.
.. method:: remove(*objs)
.. method:: remove(*objs
, bulk=True
)
Removes the specified model objects from the related object set::
Removes the specified model objects from the related object set::
...
@@ -129,7 +129,10 @@ Related objects reference
...
@@ -129,7 +129,10 @@ Related objects reference
:data:`~django.db.models.signals.post_save` signals and comes at the
:data:`~django.db.models.signals.post_save` signals and comes at the
expense of performance.
expense of performance.
.. method:: clear()
For many-to-many relationships, the ``bulk`` keyword argument doesn't
exist.
.. method:: clear(bulk=True)
Removes all objects from the related object set::
Removes all objects from the related object set::
...
@@ -143,6 +146,9 @@ Related objects reference
...
@@ -143,6 +146,9 @@ Related objects reference
:class:`~django.db.models.ForeignKey`\s where ``null=True`` and it also
:class:`~django.db.models.ForeignKey`\s where ``null=True`` and it also
accepts the ``bulk`` keyword argument.
accepts the ``bulk`` keyword argument.
For many-to-many relationships, the ``bulk`` keyword argument doesn't
exist.
.. method:: set(objs, bulk=True, clear=False)
.. method:: set(objs, bulk=True, clear=False)
Replace the set of related objects::
Replace the set of related objects::
...
@@ -156,7 +162,11 @@ Related objects reference
...
@@ -156,7 +162,11 @@ Related objects reference
If ``clear=True``, the ``clear()`` method is called instead and the
If ``clear=True``, the ``clear()`` method is called instead and the
whole set is added at once.
whole set is added at once.
The ``bulk`` argument is passed on to :meth:`add`.
For :class:`~django.db.models.ForeignKey` objects, the ``bulk``
argument is passed on to :meth:`add` and :meth:`remove`.
For many-to-many relationships, the ``bulk`` keyword argument doesn't
exist.
Note that since ``set()`` is a compound operation, it is subject to
Note that since ``set()`` is a compound operation, it is subject to
race conditions. For instance, new objects may be added to the database
race conditions. For instance, new objects may be added to the database
...
...
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