'Create a generator for model instances for entities.
Iterating through entities moves query range past the consumed entities.
Yields:
next model instance.'

def __iter__(self):

    while True:
        query = self._key_range.make_ascending_query(util.for_name(self._entity_kind))
        results = query.fetch(limit=self._batch_size)
        if (not results):
            break
        for model_instance in results:
            key = model_instance.key()
            self._key_range.advance(key)
            (yield model_instance)
