{{{
My(models.Model):
...
duration = models.DurationField(default=timedelta(seconds=0))
}}}
and I try to increment durations via F expression:
{{{
obj.duration = F('duration') + (now - some_other_datetime)
}}}
as a result, we have a value of the following format in the database:
0:18:30.233251 instead of a big integer one. So this makes that instance
of model completely unusable, any attempt of access raise an exception:
TypeError: unsupported type for timedelta microseconds component: str
--
Ticket URL: <https://code.djangoproject.com/ticket/32249>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* type: Uncategorized => Bug
* resolution: => duplicate
Comment:
Duplicate of #28925, fixed in dd5aa8cb5ffc0a89c4b9b8dee45c1c919d203489
(Django 3.2+).
--
Ticket URL: <https://code.djangoproject.com/ticket/32249#comment:1>