#NEWLINE# def finalize( self ) : #NEWLINE# #INDENT# '\n        ' #NEWLINE# self . flush_deferred_objects ( ) #NEWLINE# if len ( self . AFTER_LOAD_HANDLERS ) : #NEWLINE# #INDENT# logger . info ( 'Finalize %d after_load handlers' , len ( self . AFTER_LOAD_HANDLERS ) ) #NEWLINE# #UNINDENT# for h in self . AFTER_LOAD_HANDLERS : #NEWLINE# #INDENT# logger . info ( 'Running after_load handler %s' , h . __doc__ ) #NEWLINE# h ( self ) #NEWLINE# #UNINDENT# logger . info ( 'Loaded %d objects' , self . count_objects ) #NEWLINE# if self . save_later : #NEWLINE# #INDENT# count = 0 #NEWLINE# s = '' #NEWLINE# for ( model , msg_objects ) in list ( self . save_later . items ( ) ) : #NEWLINE# #INDENT# for ( msg , objects ) in list ( msg_objects . items ( ) ) : #NEWLINE# #INDENT# if False : #NEWLINE# #INDENT# s += ( '\n- %s %s (%d object(s), e.g. %s)' % ( full_model_name ( model ) , msg , len ( objects ) , obj2str ( objects [ 0 ] . object , force_detailed = True ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s += ( '\n- %s %s (%d object(s) with primary key %s)' % ( full_model_name ( model ) , msg , len ( objects ) , ', ' . join ( [ str ( o . object . pk ) for o in objects ] ) ) ) #NEWLINE# #UNINDENT# count += len ( objects ) #NEWLINE# #UNINDENT# #UNINDENT# msg = ( 'Abandoning with %d unsaved instances:%s' % ( count , s ) ) #NEWLINE# logger . warning ( msg )