Ticket #9209: db_model_fields.patch

File db_model_fields.patch, 471 bytes (added by Rozza, 16 years ago)

Patch to catch errors when converting to an int

  • db/models/fields/__init__.py

     
    350350    def get_db_prep_value(self, value):
    351351        if value is None:
    352352            return None
     353        try:
     354            int(value)
     355        except:
     356            return None
    353357        return int(value)
    354358
    355359    def contribute_to_class(self, cls, name):
Back to Top