Closed as not planned
Description
When serializing a datetime.timedelta()
as part of a JSON-object, it is serialized as the total number of seconds. Support for this was introduced in #584. When using a serializers.DurationField
, it is serialized as a HH:MM:DD
-like string, as introduced in #2989.
This can be quite troublesome on the client, since different API:s will have different behaviour depending on their implementation. In my specific use-case we transform the data from the API into moment.js duration objects, and depending on API implementation this currently has to be done in different ways.
I realize this would be a breaking change, but I think it is worth to discuss.