mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +00:00
Fixed #28399 -- Fixed QuerySet.count() for union(), difference(), and intersection() queries.
This commit is contained in:
parent
9290f15bb5
commit
adab280cef
5 changed files with 39 additions and 11 deletions
|
@ -821,11 +821,15 @@ of other models. Passing different models works as long as the ``SELECT`` list
|
|||
is the same in all ``QuerySet``\s (at least the types, the names don't matter
|
||||
as long as the types in the same order).
|
||||
|
||||
In addition, only ``LIMIT``, ``OFFSET``, and ``ORDER BY`` (i.e. slicing and
|
||||
:meth:`order_by`) are allowed on the resulting ``QuerySet``. Further, databases
|
||||
place restrictions on what operations are allowed in the combined queries. For
|
||||
example, most databases don't allow ``LIMIT`` or ``OFFSET`` in the combined
|
||||
queries.
|
||||
In addition, only ``LIMIT``, ``OFFSET``, ``COUNT(*)``, and ``ORDER BY`` (i.e.
|
||||
slicing, :meth:`count`, and :meth:`order_by`) are allowed on the resulting
|
||||
``QuerySet``. Further, databases place restrictions on what operations are
|
||||
allowed in the combined queries. For example, most databases don't allow
|
||||
``LIMIT`` or ``OFFSET`` in the combined queries.
|
||||
|
||||
.. versionchanged:: 1.11.4
|
||||
|
||||
``COUNT(*)`` support was added.
|
||||
|
||||
``intersection()``
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue