Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit a67b35a0aa2b7a947605cfabfecdf906f8ad41c4 1 parent 6dc0499
Karen Tracey authored April 12, 2010

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  docs/ref/models/querysets.txt
12  docs/ref/models/querysets.txt
@@ -357,8 +357,8 @@ query spans multiple tables, it's possible to get duplicate results when a
357 357
 ``values(*fields)``
358 358
 ~~~~~~~~~~~~~~~~~~~
359 359
 
360  
-Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that evaluates to a list of
361  
-dictionaries instead of model-instance objects.
  360
+Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when
  361
+used as an iterable, rather than model-instance objects.
362 362
 
363 363
 Each of those dictionaries represents an object, with the keys corresponding to
364 364
 the attribute names of model objects.
@@ -442,10 +442,10 @@ individualism.
442 442
 
443 443
 .. versionadded:: 1.0
444 444
 
445  
-This is similar to ``values()`` except that instead of returning a list of
446  
-dictionaries, it returns a list of tuples. Each tuple contains the value from
447  
-the respective field passed into the ``values_list()`` call -- so the first
448  
-item is the first field, etc. For example::
  445
+This is similar to ``values()`` except that instead of returning dictionaries,
  446
+it returns tuples when iterated over. Each tuple contains the value from the
  447
+respective field passed into the ``values_list()`` call -- so the first item is
  448
+the first field, etc. For example::
449 449
 
450 450
     >>> Entry.objects.values_list('id', 'headline')
451 451
     [(1, u'First entry'), ...]

0 notes on commit a67b35a

Please sign in to comment.
Something went wrong with that request. Please try again.