Ticket #16421: timefield.diff

File timefield.diff, 584 bytes (added by Adam Mckerlie, 13 years ago)

Patch for #16421

  • django/db/models/fields/__init__.py

     
    11601160        if val is None:
    11611161            data = ''
    11621162        else:
    1163             data = val.strftime("%H:%M:%S")
     1163            try:
     1164                data = val.strftime("%H:%M:%S")
     1165            except AttributeError:
     1166                data = datetime.datetime.strptime(val, "%H:%M:%S")
    11641167        return data
    11651168
    11661169    def formfield(self, **kwargs):
Back to Top