|
|
|
@ -1314,8 +1314,8 @@ class Freizeit(CommonModel):
|
|
|
|
.annotate(total_duration=Sum('duration'))# Sum durations for each day
|
|
|
|
.annotate(total_duration=Sum('duration'))# Sum durations for each day
|
|
|
|
.annotate(
|
|
|
|
.annotate(
|
|
|
|
sum_days=Case(
|
|
|
|
sum_days=Case(
|
|
|
|
When(total_duration__gt=5.0, then=Value(1.0)),
|
|
|
|
When(total_duration__gte=5.0, then=Value(1.0)),
|
|
|
|
When(total_duration__gt=2.5, then=Value(0.5)),
|
|
|
|
When(total_duration__gte=2.5, then=Value(0.5)),
|
|
|
|
default=Value(0.0),)
|
|
|
|
default=Value(0.0),)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.order_by('day') # Sort results by date
|
|
|
|
.order_by('day') # Sort results by date
|
|
|
|
|