#NEWLINE# def get_diff( self , original , current , dry_run = False ) : #NEWLINE# #INDENT# '\n        Get diff between original and current object when ``import_data``\n        is run.\n\n        ``dry_run`` allows handling special cases when object is not saved\n        to database (ie. m2m relationships).\n        ' #NEWLINE# data = [ ] #NEWLINE# dmp = diff_match_patch ( ) #NEWLINE# for field in self . get_fields ( ) : #NEWLINE# #INDENT# v1 = ( self . export_field ( field , v1 ) if original else '' ) #NEWLINE# v2 = ( self . export_field ( field , current ) if current else '' ) #NEWLINE# diff = dmp . diff_main ( force_text ( v1 ) , force_text ( v2 ) ) #NEWLINE# dmp . diff_cleanupSemantic ( diff ) #NEWLINE# html = dmp . diff_prettyHtml ( diff ) #NEWLINE# html = mark_safe ( html ) #NEWLINE# data . append ( html ) #NEWLINE# #UNINDENT# return data