My initial thought is that this has something to do with the conversion
process of a given string value into a {{{timedelta}}}, etc., but I
haven't had a chance to really dig in, yet. I just barely finished work
and I have to run a bunch of errands, or I'd dive straight into the code.
However, I wanted to at least get the bug report in here right away.
--
Ticket URL: <https://code.djangoproject.com/ticket/24445>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* component: Uncategorized => Forms
* needs_tests: => 0
* version: 1.7 => master
* needs_docs: => 0
* type: Uncategorized => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:1>
* severity: Normal => Release blocker
Comment:
I've set the severity to release blocker, since this is essentially the
same regression (thought via different means) as #24391. I've looked
through the code a bit and can't find anything obvious that could be
causing this issue. I'm going to look some more tomorrow night.
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:2>
* severity: Release blocker => Normal
Comment:
In fact, you'll find the exact same behavior with current date-based
fields. If you provide an initial or default value, you should provide a
date/datetime Python value, not a string representation. By analogy, you
should provide a `timedelta` value for your `DurationField` default value.
We *could* change that, other opinions welcome.
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:3>
* status: new => closed
* resolution: => wontfix
Comment:
I don't see a need to complicate things by allowing differing types for
defaults. Maybe there's an opportunity to use the checks framework to
validate defaults are the proper type, but I'll leave that for a new
ticket if someone wants to try implementing it.
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:4>
* resolution: wontfix => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:5>
Comment (by yoyoma):
@claudep @timgraham {{{timedelta}}} is obviously the right thing to use
here, and I'm not sure what in the world I was thinking when I used a
string. I think it was because I was getting so used to typing the string
value into the admin, and just totally spaced it. I'm sorry for wasting a
ticket and your time before simply taking 30 seconds to RTFM @
https://docs.djangoproject.com/en/1.8/ref/models/fields/#durationfield
--
Ticket URL: <https://code.djangoproject.com/ticket/24445#comment:6>