[1.7.x] Fixed #12030 -- Validate integer field range at the model level.

Thanks to @timgraham for the review.

Backport of 1506c71a95 from master
This commit is contained in:
Simon Charette 2014-03-03 20:12:42 -05:00
parent 7eaf329ad3
commit 78211b13a5
8 changed files with 153 additions and 26 deletions

View file

@ -678,6 +678,11 @@ Models
Previously this used to work if the field accepted integers as input as it
took the primary key.
* Integer fields are now validated against database backend specific min and
max values based on their :meth:`internal_type <django.db.models.Field.get_internal_type>`.
Previously model field validation didn't prevent values out of their associated
column data type range from being saved resulting in an integrity error.
Signals
^^^^^^^