﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19448	BaseDatabaseFeatures convert_values	anton.nagornyi@…	nobody	"In django.db.backends there is convert_values function. I have declared custom field which corresponds to Postgresql interval type. By default convert_values assumes that unknown type is float. Is it possible to change this behaviour? Like that (look at return):


{{{

    def convert_values(self, value, field):
        """"""Coerce the value returned by the database backend into a consistent type that
        is compatible with the field type.
        """"""
        internal_type = field.get_internal_type()
        if internal_type == 'DecimalField':
            return value
        elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField':
            return int(value)
        elif internal_type in ('DateField', 'DateTimeField', 'TimeField'):
            return value
        # No field, or the field isn't known to be a decimal or integer
        # Default to a float 
        #return float(value)
        #Not to a float. Just leave as is
        return value
}}}
"	Cleanup/optimization	closed	Core (Other)	1.4	Normal	duplicate	convert_values		Unreviewed	0	0	0	0	0	0
