Changes between Version 2 and Version 3 of Ticket #17653, comment 11
- Timestamp:
- Feb 13, 2012, 2:56:39 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #17653, comment 11
v2 v3 1 1 Sorry for delay, but the ticket is not as easy as I thought. 2 2 3 I attached a patch similar to akaariai's patch. It validates value for primary key in new method `BaseDatabaseOperations.validate_autopk_value` in module `db.backends`. The method is overriden in `DatabaseOperations` in module `db.backends.mysql` , soit does not use `allows_primary_key_0` flag. The method is called by `AutoField.get_db_prep_value` from module `db.models.fields`. The patch includes simple test.3 I attached a patch similar to akaariai's patch. It validates value for primary key in new method `BaseDatabaseOperations.validate_autopk_value` in module `db.backends`. The method is overriden in `DatabaseOperations` in module `db.backends.mysql` and it does not use `allows_primary_key_0` flag. The method is called by `AutoField.get_db_prep_value` from module `db.models.fields`. The patch includes simple test. 4 4 5 5 I'm not sure if `get_db_prep_value` is right place for validation. The doc of the method says: