#NEWLINE# def _ondelta_get_differences( self ) : #NEWLINE# #INDENT# assert ( self . _ondelta_shadow is not None ) #NEWLINE# fields_changed = dict ( ) #NEWLINE# for field_name in self . _ondelta_fields_to_watch : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# snapshot_value = getattr ( self . _ondelta_shadow , field_name ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logger . exception ( 'Failed to retrieve the old value of {model}.{field} for comparison' . format ( model = self . __class__ . __name__ , field = field_name ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# current_value = getattr ( self , field_name ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logger . exception ( 'Failed to retrieve the new value of {model}.{field} for comparison' . format ( model = self . __class__ . __name__ , field = field_name ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( snapshot_value != current_value ) : #NEWLINE# #INDENT# fields_changed [ field_name ] = { #NEWLINE# #INDENT# 'old' : snapshot_value , #NEWLINE# 'new' : current_value , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# return fields_changed