DateTime fields are not checked when updating object
|Reported by:||mikhail@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I created an object, but after that I updated it in Django admin and edited DateTimeField to 2006-02-31 00:00:00. In database there is 0000-00-00 00:00:00, and I get an exception when refering to object:
ValueError at /games/game/1/ year is out of range Request Method: POST Request URL: http://localhost:8000/games/game/1/ Exception Type: ValueError Exception Value: year is out of range Exception Location: /usr/lib/python2.4/site-packages/MySQLdb/connections.py in defaulterrorhandler, line 33
Please verify that the date is correct before inserting/updating. See function time.strptime in Python.
Also IntegerField (and PositiveIntegerField) is not checked but simply substituted by database to 231-1 if larger during inserting/updating.
Change History (3)
comment:1 Changed 7 years ago by SmileyChris
- Component changed from Validators to Admin interface
- Triage Stage changed from Unreviewed to Accepted