View source on GitHub |
An iterator over the results from Batches obtained from a Batcher.
Inherits From: expected_type
google.appengine.datastore.datastore_query.ResultsIterator(
batcher
)
ResultsIterator implements Python's iterator protocol, so results can be accessed with the for-statement:
it = ResultsIterator(Query(kind='Person').run()) for person in it: print 'Hi, %s!' % person['name']
At any time ResultsIterator.cursor() can be used to grab the Cursor that points just after the last result returned by the iterator.
Args | |
---|---|
batcher
|
A datastore_query.Batcher |
Methods
cursor
cursor()
Returns a cursor that points just after the last result returned.
If next() throws an exception, this function returns the end_cursor from the last successful batch or throws the same exception if no batch was successful.
index_list
index_list()
Returns the list of indexes used to perform the query. Possibly None when the adapter does not implement pb_to_index.
next
next()
__iter__
__iter__()