#NEWLINE# @ classmethod #NEWLINE# def value_dict( cls , value ) : #NEWLINE# #INDENT# d = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if isinstance ( value , ( str , unicode ) ) : #NEWLINE# #INDENT# d [ 'value_str' ] = cls . StringValueModel . objects . get_or_create ( value = value ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( d , ( int , long ) ) : #NEWLINE# #INDENT# d [ 'value_int' ] = value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , float ) : #NEWLINE# #INDENT# d [ 'value_float' ] = value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise SyntaxError ( ( 'Unknown type for %s (%r)' % ( type ( value ) , value ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return d