#NEWLINE# def clean( self , value ) : #NEWLINE# #INDENT# ' (Try to) parse JSON string back to python. ' #NEWLINE# if isinstance ( value , six . string_types ) : #NEWLINE# #INDENT# if ( value == '' ) : #NEWLINE# #INDENT# value = None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# value = json . loads ( value ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise ValidationError ( 'Could not parse value as JSON' ) #NEWLINE# #UNINDENT# #UNINDENT# return self