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
8fb53c50
Kaydet (Commit)
8fb53c50
authored
Agu 16, 2016
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Agu 16, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19222 -- Documented that default managers aren't used for related queries.
üst
c969b17a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
managers.txt
docs/topics/db/managers.txt
+7
-1
No files found.
docs/topics/db/managers.txt
Dosyayı görüntüle @
8fb53c50
...
...
@@ -204,7 +204,7 @@ Using managers for related object access
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, Django uses an instance of the ``Model._base_manager`` manager
class when accessing related objects (i.e. ``choice.
poll
``), not the
class when accessing related objects (i.e. ``choice.
question
``), not the
``_default_manager`` on the related object. This is because Django needs to be
able to retrieve the related object, even if it would otherwise be filtered out
(and hence be inaccessible) by the default manager.
...
...
@@ -214,6 +214,12 @@ appropriate for your circumstances, you can tell Django which class to use by
setting :attr:`Meta.base_manager_name
<django.db.models.Options.base_manager_name>`.
Manager's aren't used when querying on related models. For example, if the
``Question`` model :ref:`from the tutorial <creating-models>` had a ``deleted``
field and a base manager that filters out instances with ``deleted=True``, a
queryset like ``Choice.objects.filter(question__name__startswith='What')``
would include choices related to deleted questions.
Don't filter away any results in this type of manager subclass
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
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