Django

Code

Changeset 6303

Show
Ignore:
Timestamp:
09/15/07 13:31:50 (1 year ago)
Author:
adrian
Message:

Fixed #5275 -- Documented QuerySet?.iterator(). Thanks, ubernostrum

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/db-api.txt

    r6293 r6303  
    952952If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary. 
    953953 
     954``iterator()`` 
     955~~~~~~~~~~~~ 
     956 
     957Evaluates the ``QuerySet`` (by performing the query) and returns an 
     958`iterator`_ over the results. A ``QuerySet`` typically reads all of 
     959its results and instantiates all of the corresponding objects the 
     960first time you access it; ``iterator()`` will instead read results and 
     961instantiate objects in discrete chunks, yielding them one at a 
     962time. For a ``QuerySet`` which returns a large number of objects, this 
     963often results in better performance and a significant reduction in 
     964memory use. 
     965 
     966Note that using ``iterator()`` on a ``QuerySet`` which has already 
     967been evaluated will force it to evaluate again, repeating the query. 
     968 
     969.. _iterator: http://www.python.org/dev/peps/pep-0234/ 
     970 
    954971``latest(field_name=None)`` 
    955972~~~~~~~~~~~~~~~~~~~~~~~~~~~