#NEWLINE# @ classmethod #NEWLINE# def process_cursor_for_update( self , connection , cursor , fields ) : #NEWLINE# #INDENT# total = self . hook_row_count ( connection , cursor ) #NEWLINE# created = 0 #NEWLINE# existing = 0 #NEWLINE# for row in cursor . fetchall ( ) : #NEWLINE# #INDENT# desc = is_a ( self . model , search_attr = self . search_attr , fk = True , skip_missing = True ) #NEWLINE# element = self . get_object ( desc , row [ self . search_attr ] ) #NEWLINE# if ( element is not None ) : #NEWLINE# #INDENT# existing += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# created += 1 #NEWLINE# #UNINDENT# sys . stdout . write ( ( '\rSearch for missing Instances (exist/created/total):  %d/%d/%d' % ( existing , created , total ) ) ) #NEWLINE# sys . stdout . flush ( ) #NEWLINE# if ( element is not None ) : #NEWLINE# #INDENT# self . hook_update_existing ( element , row ) #NEWLINE# continue #NEWLINE# #UNINDENT# self . create_instance_from_row ( row ) #NEWLINE# #UNINDENT# print ( '' )