summaryrefslogtreecommitdiff
path: root/docs/ref/models/querysets.txt
diff options
context:
space:
mode:
authorClifford Gama <cliffygamy@gmail.com>2026-01-17 12:41:15 +0200
committerJacob Walls <jacobtylerwalls@gmail.com>2026-01-19 09:58:43 -0500
commitd6cca8b904de144946453aea93dd627c09abfca9 (patch)
tree00d2c0bee16413dbc3e223f36444a56680a619bb /docs/ref/models/querysets.txt
parent25416413470d8e6630528626ee8b033d2d77ff46 (diff)
Refs #25508 -- Updated outdated QuerySet.__repr__() results.
Diffstat (limited to 'docs/ref/models/querysets.txt')
-rw-r--r--docs/ref/models/querysets.txt21
1 files changed, 8 insertions, 13 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 2fbcd4b942..fbe562c883 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -549,22 +549,17 @@ Examples (those after the first will only work on PostgreSQL):
.. code-block:: pycon
>>> Author.objects.distinct()
- [...]
-
+ <QuerySet [...]>
>>> Entry.objects.order_by("pub_date").distinct("pub_date")
- [...]
-
+ <QuerySet [...]>
>>> Entry.objects.order_by("blog").distinct("blog")
- [...]
-
+ <QuerySet [...]>
>>> Entry.objects.order_by("author", "pub_date").distinct("author", "pub_date")
- [...]
-
+ <QuerySet [...]>
>>> Entry.objects.order_by("blog__name", "mod_date").distinct("blog__name", "mod_date")
- [...]
-
+ <QuerySet [...]>
>>> Entry.objects.order_by("author", "pub_date").distinct("author")
- [...]
+ <QuerySet [...]>
.. note::
Keep in mind that :meth:`order_by` uses any default related model ordering
@@ -1204,7 +1199,7 @@ and run:
.. code-block:: pycon
>>> Pizza.objects.all()
- ["Hawaiian (ham, pineapple)", "Seafood (prawns, smoked salmon)"...
+ <QuerySet [<Pizza: Hawaiian (ham, pineapple)>, <Pizza: Seafood (prawns, smoked salmon)>, ...]>
The problem with this is that every time ``Pizza.__str__()`` asks for
``self.toppings.all()`` it has to query the database, so
@@ -4240,7 +4235,7 @@ attribute:
>>> prefetch = Prefetch("choice_set", queryset=voted_choices, to_attr="voted_choices")
>>> Question.objects.prefetch_related(prefetch).get().voted_choices
- [<Choice: The sky>]
+ <QuerySet [<Choice: The sky>]>
>>> Question.objects.prefetch_related(prefetch).get().choice_set.all()
<QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]>