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
af67b93c
Kaydet (Commit)
af67b93c
authored
Eyl 06, 2013
tarafından
Matthew Rich
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
re-indented method documentation within RelatedManager
üst
a5bcc09c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
relations.txt
docs/ref/models/relations.txt
+5
-10
No files found.
docs/ref/models/relations.txt
Dosyayı görüntüle @
af67b93c
...
...
@@ -36,12 +36,7 @@ Related objects reference
In this example, the methods below will be available both on
``topping.pizza_set`` and on ``pizza.toppings``.
.. _related-manager-methods:
Related Manager Methods
-----------------------
.. method:: add(obj1, [obj2, ...])
.. method:: add(obj1, [obj2, ...])
Adds the specified model objects to the related object set.
...
...
@@ -61,7 +56,7 @@ Related Manager Methods
some custom logic when a relationship is created, listen to the
:data:`~django.db.models.signals.m2m_changed` signal.
.. method:: create(**kwargs)
.. method:: create(**kwargs)
Creates a new object, saves it and puts it in the related object set.
Returns the newly created object::
...
...
@@ -91,7 +86,7 @@ Related Manager Methods
parameter ``blog`` to ``create()``. Django figures out that the new
``Entry`` object's ``blog`` field should be set to ``b``.
.. method:: remove(obj1, [obj2, ...])
.. method:: remove(obj1, [obj2, ...])
Removes the specified model objects from the related object set::
...
...
@@ -115,7 +110,7 @@ Related Manager Methods
the ``blog`` :class:`~django.db.models.ForeignKey` doesn't have
``null=True``, this is invalid.
.. method:: clear()
.. method:: clear()
Removes all objects from the related object set::
...
...
@@ -128,7 +123,7 @@ Related Manager Methods
Just like ``remove()``, ``clear()`` is only available on
:class:`~django.db.models.ForeignKey`\s where ``null=True``.
.. note::
.. note::
Note that ``add()``, ``create()``, ``remove()``, and ``clear()`` all
apply database changes immediately for all types of related fields. In other
...
...
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