Changes between Version 2 and Version 3 of Ticket #17653, comment 11


Ignore:
Timestamp:
02/13/2012 02:56:39 PM (4 years ago)
Author:
krzysiumed
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17653, comment 11

    v2 v3  
    11Sorry for delay, but the ticket is not as easy as I thought.
    22
    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`, so 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.
     3I 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.
    44
    55I'm not sure if `get_db_prep_value` is right place for validation. The doc of the method says:
Back to Top