Ticket #3146: unicode_strftime_fix.2.diff

File unicode_strftime_fix.2.diff, 530 bytes (added by deepak <deep.thukral@…>, 8 years ago)
  • db/models/fields/__init__.py

     
    537537
    538538    def get_db_prep_save(self, value):
    539539        # Casts dates into string format for entry into database.
    540         if value is not None:
     540        if value is not None and hasattr(value, 'strftime'):
    541541            value = value.strftime('%Y-%m-%d')
    542542        return Field.get_db_prep_save(self, value)
    543543
Back to Top