Ticket #225 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

Tweak to ease default values for TimeFields?

Reported by: anonymous Owned by: andrew
Priority: minor Milestone: 0.7
Component: migrations Version: 0.6
Keywords: Cc:

Description

Hi

In a model I have a TimeField? which is related to, say, a moment in a video clip, which (for reasons pointless to explain here), defines the option default=datetime.time(0,1)

Django doesn't mind this, but when migrating, postgres chokes because the time is, say: 00:01:00 and it doesn't like the colons.

So, a workaround is default=('%s' % datetime.time(0,0)) but I thought I'd suggest perhaps a little auto-to-string conversion, just to make life easier?

Cheers
Steve

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.7

Looks like we need to do some casting; not a vital fix, so scheduling for 0.7.

comment:2 Changed 5 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in [44ed48f7ee0a].

Note: See TracTickets for help on using tickets.