Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12743 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1eee40234b8366617fa3455cd7c4d16f754fe830 1 parent 70037f8
Malcolm Tredinnick authored March 10, 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
@@ -361,8 +361,8 @@ query spans multiple tables, it's possible to get duplicate results when a
361 361
 ``values(*fields)``
362 362
 ~~~~~~~~~~~~~~~~~~~
363 363
 
364  
-Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that evaluates to a list of
365  
-dictionaries instead of model-instance objects.
  364
+Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when
  365
+used as an iterable, rather than model-instance objects.
366 366
 
367 367
 Each of those dictionaries represents an object, with the keys corresponding to
368 368
 the attribute names of model objects.
@@ -446,10 +446,10 @@ individualism.
446 446
 
447 447
 .. versionadded:: 1.0
448 448
 
449  
-This is similar to ``values()`` except that instead of returning a list of
450  
-dictionaries, it returns a list of tuples. Each tuple contains the value from
451  
-the respective field passed into the ``values_list()`` call -- so the first
452  
-item is the first field, etc. For example::
  449
+This is similar to ``values()`` except that instead of returning dictionaries,
  450
+it returns tuples when iterated over. Each tuple contains the value from the
  451
+respective field passed into the ``values_list()`` call -- so the first item is
  452
+the first field, etc. For example::
453 453
 
454 454
     >>> Entry.objects.values_list('id', 'headline')
455 455
     [(1, u'First entry'), ...]

0 notes on commit 1eee402

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