#NEWLINE# def __iter__( self ) : #NEWLINE# #INDENT# self . _query = self . _key_range . make_ascending_query ( util . for_name ( self . _query_spec . model_class_path ) , filters = self . _query_spec . filters ) #NEWLINE# if isinstance ( self . _query , db . Query ) : #NEWLINE# #INDENT# if self . _cursor : #NEWLINE# #INDENT# self . _query . with_cursor ( self . _cursor ) #NEWLINE# #UNINDENT# for model_instance in self . _query . run ( batch_size = self . _query_spec . batch_size , keys_only = self . _query_spec . keys_only ) : #NEWLINE# #INDENT# ( yield model_instance ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _query = self . _query . iter ( batch_size = self . _query_spec . batch_size , keys_only = self . _query_spec . keys_only , start_cursor = model_instance . _cursor , produce_cursors = True ) #NEWLINE# for model_instance in self . _query : #NEWLINE# #INDENT# ( yield model_instance )