summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt12
-rw-r--r--docs/releases/6.1.txt4
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 579c0de302..cc264a4e51 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -170,6 +170,18 @@ Here's the formal declaration of a ``QuerySet``:
:meth:`order_by` clause or a default ordering on the model.
``False`` otherwise.
+ .. attribute:: totally_ordered
+
+ .. versionadded:: 6.1
+
+ Returns ``True`` if the ``QuerySet`` is ordered and the ordering is
+ deterministic. This requires that the ordering includes a field
+ (or set of fields) that is unique and non-nullable.
+
+ For queries involving a ``GROUP BY`` clause, the model's default
+ ordering is ignored. Ordering specified via ``.extra(order_by=...)``
+ is also ignored.
+
.. attribute:: db
The database that will be used if this query is executed now.
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt
index 85699324cd..ee78a7b123 100644
--- a/docs/releases/6.1.txt
+++ b/docs/releases/6.1.txt
@@ -287,6 +287,10 @@ Models
* :class:`~django.db.models.StringAgg` now supports ``distinct=True`` on SQLite
when using the default delimiter ``Value(",")`` only.
+* The new :attr:`.QuerySet.totally_ordered` property returns ``True`` if the
+ :class:`~django.db.models.query.QuerySet` is ordered and the ordering is
+ deterministic.
+
Pagination
~~~~~~~~~~