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
abe6c5de
Kaydet (Commit)
abe6c5de
authored
Eki 30, 2017
tarafından
Jezeniel Zapanta
Kaydeden (comit)
Tim Graham
Mar 21, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28514 -- Clarifed docs about idempotence of RelatedManager.add().
üst
1834490a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
AUTHORS
AUTHORS
+1
-0
relations.txt
docs/ref/models/relations.txt
+7
-3
many_to_many.txt
docs/topics/db/examples/many_to_many.txt
+1
-1
No files found.
AUTHORS
Dosyayı görüntüle @
abe6c5de
...
@@ -385,6 +385,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -385,6 +385,7 @@ answer newbie questions, and generally made Django that much better:
Jeremy Dunck <jdunck@gmail.com>
Jeremy Dunck <jdunck@gmail.com>
Jeremy Lainé <jeremy.laine@m4x.org>
Jeremy Lainé <jeremy.laine@m4x.org>
Jesse Young <adunar@gmail.com>
Jesse Young <adunar@gmail.com>
Jezeniel Zapanta <jezeniel.zapanta@gmail.com>
jhenry <jhenry@theonion.com>
jhenry <jhenry@theonion.com>
Jim Dalton <jim.dalton@gmail.com>
Jim Dalton <jim.dalton@gmail.com>
Jimmy Song <jaejoon@gmail.com>
Jimmy Song <jaejoon@gmail.com>
...
...
docs/ref/models/relations.txt
Dosyayı görüntüle @
abe6c5de
...
@@ -56,11 +56,15 @@ Related objects reference
...
@@ -56,11 +56,15 @@ Related objects reference
manager perform the update by calling ``e.save()``.
manager perform the update by calling ``e.save()``.
Using ``add()`` with a many-to-many relationship, however, will not
Using ``add()`` with a many-to-many relationship, however, will not
call any ``save()`` methods
, but rather create the relationships
call any ``save()`` methods
(the ``bulk`` argument doesn't exist), but
using :meth:`QuerySet.bulk_create()
rather create the relationships
using :meth:`QuerySet.bulk_create()
<django.db.models.query.QuerySet.bulk_create>`. If you need to execute
<django.db.models.query.QuerySet.bulk_create>`. If you need to execute
some custom logic when a relationship is created, listen to the
some custom logic when a relationship is created, listen to the
:data:`~django.db.models.signals.m2m_changed` signal.
:data:`~django.db.models.signals.m2m_changed` signal, which will
trigger ``pre_add`` and ``post_add`` actions.
Using ``add()`` on a relation that already exists won't duplicate the
relation, but it will still trigger signals.
.. method:: create(**kwargs)
.. method:: create(**kwargs)
...
...
docs/topics/db/examples/many_to_many.txt
Dosyayı görüntüle @
abe6c5de
...
@@ -75,7 +75,7 @@ Create another ``Article``, and set it to appear in both ``Publications``::
...
@@ -75,7 +75,7 @@ Create another ``Article``, and set it to appear in both ``Publications``::
>>> a2.publications.add(p1, p2)
>>> a2.publications.add(p1, p2)
>>> a2.publications.add(p3)
>>> a2.publications.add(p3)
Adding a second time is OK::
Adding a second time is OK
, it will not duplicate the relation
::
>>> a2.publications.add(p3)
>>> a2.publications.add(p3)
...
...
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