Skip to content Skip to sidebar Skip to footer

Aggregate In Django With Duration Field

My model is: class Mo(Model): dur = DurationField(default=timedelta(0)) price_per_minute = FloatField(default=0.0) minutes_int = IntegerField(default=0) # dublicates

Solution 1:

You can use ExpressionWrapper(F('dur'), output_field=BigIntegerField()) to make Django treat dur as an integer value.


Post a Comment for "Aggregate In Django With Duration Field"