'Get next Model instance in query results.
Returns:
Next model instance.
Raises:
StopIteration when there are no more results in query.'

def next(self):

    if (self.__model_class is not None):
        return self.__model_class.from_entity(self.__iterator.next())
    else:
        while True:
            entity = self.__iterator.next()
            try:
                model_class = class_for_kind(entity.kind())
            except KindError:
                if datastore_types.RESERVED_PROPERTY_NAME.match(entity.kind()):
                    continue
                raise
            else:
                return model_class.from_entity(entity)
