#NEWLINE# def validate( self , value , model_instance ) : #NEWLINE# #INDENT# super ( JSONField , self ) . validate ( value , model_instance ) #NEWLINE# try : #NEWLINE# #INDENT# json . dumps ( value ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# raise exceptions . ValidationError ( self . error_messages [ 'invalid' ] , code = 'invalid' , params = { #NEWLINE# #INDENT# 'value' : value , #NEWLINE# #UNINDENT# } )