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
b496be33
Kaydet (Commit)
b496be33
authored
Agu 03, 2012
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #15932 - Documented how to supress multiple reverse relations to the same model.
Thanks Claude Paroz for the patch.
üst
d01eaf71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
fields.txt
docs/ref/models/fields.txt
+11
-3
No files found.
docs/ref/models/fields.txt
Dosyayı görüntüle @
b496be33
...
@@ -1002,9 +1002,10 @@ define the details of how the relation works.
...
@@ -1002,9 +1002,10 @@ define the details of how the relation works.
<abstract-base-classes>`; and when you do so
<abstract-base-classes>`; and when you do so
:ref:`some special syntax <abstract-related-name>` is available.
:ref:`some special syntax <abstract-related-name>` is available.
If you'd prefer Django didn't create a backwards relation, set ``related_name``
If you'd prefer Django not to create a backwards relation, set
to ``'+'``. For example, this will ensure that the ``User`` model won't get a
``related_name`` to ``'+'`` or end it with ``'+'``. For example, this will
backwards relation to this model::
ensure that the ``User`` model won't have a backwards relation to this
model::
user = models.ForeignKey(User, related_name='+')
user = models.ForeignKey(User, related_name='+')
...
@@ -1095,6 +1096,13 @@ that control how the relationship functions.
...
@@ -1095,6 +1096,13 @@ that control how the relationship functions.
Same as :attr:`ForeignKey.related_name`.
Same as :attr:`ForeignKey.related_name`.
If you have more than one ``ManyToManyField`` pointing to the same model
and want to suppress the backwards relations, set each ``related_name``
to a unique value ending with ``'+'``::
users = models.ManyToManyField(User, related_name='u+')
referents = models.ManyToManyField(User, related_name='ref+')
.. attribute:: ManyToManyField.limit_choices_to
.. attribute:: ManyToManyField.limit_choices_to
Same as :attr:`ForeignKey.limit_choices_to`.
Same as :attr:`ForeignKey.limit_choices_to`.
...
...
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