#NEWLINE# def to_python( self , value ) : #NEWLINE# #INDENT# 'Convert our string value to JSON after we load it from the DB' #NEWLINE# if ( not value ) : #NEWLINE# #INDENT# return dict ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if ( isinstance ( value , basestring ) or ( type ( value ) is unicode ) ) : #NEWLINE# #INDENT# return json . loads ( self ) #NEWLINE# #UNINDENT# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return dict ( ) #NEWLINE# #UNINDENT# return value