diff options
| author | Vishvajit Pathak <vishvajit.pathak@gmail.com> | 2018-09-10 19:23:19 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-09-10 09:54:11 -0400 |
| commit | 56dd80e573f8ffd7bce3b8db4f51f92057c12b70 (patch) | |
| tree | 19ff27c2bd1735109cee4adb5af421feade8b0d1 | |
| parent | bd5ce0599bf0dc156b943ca0d03307c7e451923c (diff) | |
[2.1.x] Fixed #29573 -- Added links in aggregation topic guide.
Backport of a48bc0cec9eaaf47c0b3de186c072cf00011c892 from master
| -rw-r--r-- | docs/topics/db/aggregation.txt | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt index 91a9b4fa3c..0609c7f63d 100644 --- a/docs/topics/db/aggregation.txt +++ b/docs/topics/db/aggregation.txt @@ -149,19 +149,20 @@ Generating aggregates for each item in a ``QuerySet`` ===================================================== 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 -a list of books, you may want to know how many authors contributed to -each book. Each Book has a many-to-many relationship with the Author; we +summary for each object in a :class:`.QuerySet`. For example, if you are +retrieving a list of books, you may want to know how many authors contributed +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``. -Per-object summaries can be generated using the ``annotate()`` clause. -When an ``annotate()`` clause is specified, each object in the ``QuerySet`` -will be annotated with the specified values. +Per-object summaries can be generated using the +:meth:`~.QuerySet.annotate` clause. When an ``annotate()`` clause is +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 -``aggregate()`` clause. Each argument to ``annotate()`` describes an -aggregate that is to be calculated. For example, to annotate books with -the number of authors: +:meth:`~.QuerySet.aggregate` clause. Each argument to ``annotate()`` describes +an aggregate that is to be calculated. For example, to annotate books with the +number of authors: .. code-block:: python |
