#NEWLINE# def error2str( self , e ) : #NEWLINE# #INDENT# 'Convert the given Exception object into a string, but handling\n    ValidationError specially.\n    ' #NEWLINE# if isinstance ( e , exceptions . ValidationError ) : #NEWLINE# #INDENT# md = getattr ( e , 'message_dict' , None ) #NEWLINE# if ( md is not None ) : #NEWLINE# #INDENT# def fieldlabel( name ) : #NEWLINE# #INDENT# de = self . get_data_elem ( name ) #NEWLINE# return force_text ( getattr ( de , 'verbose_name' , name ) ) #NEWLINE# #UNINDENT# return '\n' . join ( [ ( '%s : %s' % ( fieldlabel ( k ) , self . error2str ( v ) ) ) for ( k , v ) in list ( md . items ( ) ) ] ) #NEWLINE# #UNINDENT# return '\n' . join ( e . messages ) #NEWLINE# #UNINDENT# return str ( e )