#NEWLINE# def convert_value( self , value , expression , connection , context ) : #NEWLINE# #INDENT# '\n        Expressions provide their own converters because users have the option\n        of manually specifying the output_field which may be a different type\n        from the one the database returns.\n        ' #NEWLINE# field = self . output_field #NEWLINE# internal_type = field . get_internal_type ( ) #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( internal_type == 'FloatField' ) : #NEWLINE# #INDENT# return float ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if internal_type . endswith ( 'IntegerField' ) : #NEWLINE# #INDENT# return int ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( internal_type == 'DecimalField' ) : #NEWLINE# #INDENT# return backend_utils . typecast_decimal ( value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return value