summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorMichal Petrucha <michal.petrucha@ksp.sk>2014-11-13 19:59:00 +0100
committerTim Graham <timograham@gmail.com>2014-11-20 09:35:41 -0500
commit614dd44d0d2e5f8f12256835c3453f420f54c3b4 (patch)
treefb5f93b201c4b544aa66199f98e91f8002991bfa /docs/ref/models
parent2e7ca0994013c4238e00fd3d126f89ad3bc21b86 (diff)
[1.6.x] Fixed #23817 -- Updated docs on QuerySet evaluation
Removed inaccurate info about partial evaluation after refs #18702. Added information on modifying sliced QuerySets; refs #22503. Backport of 327df551e89a505c5756becee97c40198f38aff2 from master
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/querysets.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 1e83380200..95bac0cb06 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -39,7 +39,12 @@ You can evaluate a ``QuerySet`` in the following ways:
``QuerySet`` usually returns another unevaluated ``QuerySet``, but Django
will execute the database query if you use the "step" parameter of slice
syntax, and will return a list. Slicing a ``QuerySet`` that has been
- evaluated (partially or fully) also returns a list.
+ evaluated also returns a list.
+
+ Also note that even though slicing an unevaluated ``QuerySet`` returns
+ another unevaluated ``QuerySet``, modifying it further (e.g., adding
+ more filters, or modifying ordering) is not allowed, since that does not
+ translate well into SQL and it would not have a clear meaning either.
* **Pickling/Caching.** See the following section for details of what
is involved when `pickling QuerySets`_. The important thing for the
@@ -63,11 +68,6 @@ You can evaluate a ``QuerySet`` in the following ways:
entry_list = list(Entry.objects.all())
- Be warned, though, that this could have a large memory overhead, because
- Django will load each element of the list into memory. In contrast,
- iterating over a ``QuerySet`` will take advantage of your database to
- load data and instantiate objects only as you need them.
-
* **bool().** Testing a ``QuerySet`` in a boolean context, such as using
``bool()``, ``or``, ``and`` or an ``if`` statement, will cause the query
to be executed. If there is at least one result, the ``QuerySet`` is