Closed blueyed closed 10 years ago
Thanks @blueyed! Patch for the invalid strings.
However, I'm hesitant to assume that an arbitrary integer represents the number of seconds. If there is strong justification for it, let me know, but perhaps if an application knows it will be receiving seconds, you could simply pass timedelta(seconds=int("86400"))
to the DurationField.
I would have expected to see validation errors, in case of input like "invalid", but it gets handled as / converted to 0.
This is most likely, because
str_to_timedelta('invalid')
does not raise an exception.Also, "86400" should either gets handled as seconds (resulting in one day), or also raise an exception / validation error,