Ticket #1980: datefield_patch.diff

File datefield_patch.diff, 607 bytes (added by Rudolph Froger, 18 years ago)
  • db/models/fields/__init__.py

     
    439439
    440440    def get_db_prep_save(self, value):
    441441        # Casts dates into string format for entry into database.
    442         if value is not None:
     442        if isinstance(value, datetime.date):
    443443            value = value.strftime('%Y-%m-%d')
     444        else:
     445            value = None
    444446        return Field.get_db_prep_save(self, value)
    445447
    446448    def get_manipulator_field_objs(self):
Back to Top