Fixed #10139 -- Clarified that slicing an evaluated QuerySet returns a list, not a QuerySet. Thanks ori for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin 2012-01-21 15:32:52 +00:00
parent 905e33f84a
commit f0d4676750
1 changed files with 5 additions and 4 deletions

View File

@ -32,10 +32,11 @@ You can evaluate a ``QuerySet`` in the following ways:
print e.headline
* **Slicing.** As explained in :ref:`limiting-querysets`, a ``QuerySet`` can
be sliced, using Python's array-slicing syntax. Usually slicing a
``QuerySet`` returns another (unevaluated) ``QuerySet``, but Django will
execute the database query if you use the "step" parameter of slice
syntax.
be sliced, using Python's array-slicing syntax. Slicing an unevaluated
``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.
* **Pickling/Caching.** See the following section for details of what
is involved when `pickling QuerySets`_. The important thing for the