File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,17 @@ of the ``annotate()`` clause is a ``QuerySet``; this ``QuerySet`` can be
184
184
modified using any other ``QuerySet`` operation, including ``filter()``,
185
185
``order_by()``, or even additional calls to ``annotate()``.
186
186
187
+ .. admonition:: If in doubt, inspect the SQL query!
188
+
189
+ In order to understand what happens in your query, consider inspecting the
190
+ ``query`` property of your ``QuerySet``.
191
+
192
+ For instance, combining multiple aggregations with ``annotate()`` will
193
+ yield the wrong results, as `multiple tables are the cross joined`_,
194
+ resulting in duplicate row aggregations.
195
+
196
+ .. _multiple tables are the cross joined: https://code.djangoproject.com/ticket/10060
197
+
187
198
Joins and aggregates
188
199
====================
189
200
You can’t perform that action at this time.
0 commit comments