﻿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
15923	Validate that IntegerField is a valid Signed value for databases that don't do it themselves.	Cal Leeming	nobody	"Hey,

So I found that, if you attempt to store a number larger than the SIGNED INT maximum, for some reason, Django (or the db) auto converts it to the maximum allowed, rather than throwing an error. This really causes some strange issues, especially when your app logic *thinks* you've managed to save the correct value lol.

Suggested patch might be, enforcing a default maximum, which throws a ValueError whenever you try saving it into the database??

If this would be an appropriate way forward, I'd be more than happy to submit a patch.

Lmk

Cal

PS) To test for yourself, try using the following:

{{{

class TestModel(models.Model):
    test_field = models.IntegerField(db_index = True)

TestModel(
    test_field = 3517601254
)

TestModel.objects.get(test_field = 3517601254)


}}}
"	Bug	closed	Database layer (models, ORM)	dev	Normal	wontfix			Design decision needed	0	0	0	0	0	0
