diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2010-04-12 13:28:46 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2010-04-12 13:28:46 +0000 |
| commit | a67b35a0aa2b7a947605cfabfecdf906f8ad41c4 (patch) | |
| tree | 539cd3835eaefac06c775bd3bd3aaf77759358f9 /docs | |
| parent | 6dc0499fe7d0af5a6c886cb7362a50a769939b17 (diff) | |
[1.1.X] Fixed #11711 -- clarified that ValuesQuerySets are not lists per se.
It rarely hurts to think of the returned result from a values() or
values_list() call as a list, but it's really an iterable and sometimes
the difference matters.
r12743 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12953 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 1e6468aeec..58d1bf1aed 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -357,8 +357,8 @@ query spans multiple tables, it's possible to get duplicate results when a ``values(*fields)`` ~~~~~~~~~~~~~~~~~~~ -Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that evaluates to a list of -dictionaries instead of model-instance objects. +Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when +used as an iterable, rather than model-instance objects. Each of those dictionaries represents an object, with the keys corresponding to the attribute names of model objects. @@ -442,10 +442,10 @@ individualism. .. versionadded:: 1.0 -This is similar to ``values()`` except that instead of returning a list of -dictionaries, it returns a list of tuples. Each tuple contains the value from -the respective field passed into the ``values_list()`` call -- so the first -item is the first field, etc. For example:: +This is similar to ``values()`` except that instead of returning dictionaries, +it returns tuples when iterated over. Each tuple contains the value from the +respective field passed into the ``values_list()`` call -- so the first item is +the first field, etc. For example:: >>> Entry.objects.values_list('id', 'headline') [(1, u'First entry'), ...] |
