﻿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
2893	IntegerField (and subclasses), FloatField lack to_python method	andrew@…	Adrian Holovaty	"!IntegerField (in django.db.models.fields) and !FloatField subclass Field but do not define a to_python method.  They inherit Field's simple 'return value' to_value implementation.

This can be a problem when using Django's XML serializer and deserializer together.  Since the deserializer passes in a string representation of the value to to_python, a string representation of the value is written to the object.  This can make string formatting (%d, %f) and presumably other code unhappy.  I suspect that this may not cause a problem in all cases.  If an error is not triggered, it may be possible for the values to be saved to the database without incident, thereby allowing future retrievals to have the appropriate types.

!AutoField provides an implementation of to_python which seems appropriate to copy-and-paste into place for !IntegerField.  The positive integer variants may benefit from bounds checking.  !FloatField would need logic along similar lines"	defect	closed	Core (Other)		normal	duplicate			Unreviewed	0	0	0	0	0	0
