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
56dd80e5
Kaydet (Commit)
56dd80e5
authored
Eyl 10, 2018
tarafından
Vishvajit Pathak
Kaydeden (comit)
Tim Graham
Eyl 10, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[2.1.x] Fixed #29573 -- Added links in aggregation topic guide.
Backport of
a48bc0ce
from master
üst
bd5ce059
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
aggregation.txt
docs/topics/db/aggregation.txt
+10
-9
No files found.
docs/topics/db/aggregation.txt
Dosyayı görüntüle @
56dd80e5
...
@@ -149,19 +149,20 @@ Generating aggregates for each item in a ``QuerySet``
...
@@ -149,19 +149,20 @@ Generating aggregates for each item in a ``QuerySet``
=====================================================
=====================================================
The second way to generate summary values is to generate an independent
The second way to generate summary values is to generate an independent
summary for each object in a
``QuerySet``. For example, if you are retrieving
summary for each object in a
:class:`.QuerySet`. For example, if you are
a list of books, you may want to know how many authors contributed to
retrieving a list of books, you may want to know how many authors contributed
each book. Each Book has a many-to-many relationship with the Author; we
to
each book. Each Book has a many-to-many relationship with the Author; we
want to summarize this relationship for each book in the ``QuerySet``.
want to summarize this relationship for each book in the ``QuerySet``.
Per-object summaries can be generated using the ``annotate()`` clause.
Per-object summaries can be generated using the
When an ``annotate()`` clause is specified, each object in the ``QuerySet``
:meth:`~.QuerySet.annotate` clause. When an ``annotate()`` clause is
will be annotated with the specified values.
specified, each object in the ``QuerySet`` will be annotated with the
specified values.
The syntax for these annotations is identical to that used for the
The syntax for these annotations is identical to that used for the
``aggregate()`` clause. Each argument to ``annotate()`` describes an
:meth:`~.QuerySet.aggregate` clause. Each argument to ``annotate()`` describes
a
ggregate that is to be calculated. For example, to annotate books with
a
n aggregate that is to be calculated. For example, to annotate books with the
the
number of authors:
number of authors:
.. code-block:: python
.. code-block:: python
...
...
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