Enhance performance by prefetching more

This commit is contained in:
Joakim Hellsén 2026-04-10 22:32:38 +02:00
commit fb087a01c0
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
6 changed files with 104 additions and 12 deletions

View file

@ -34,6 +34,7 @@ def dashboard_view(request: HttpRequest) -> HttpResponse:
models.ChzzkCampaign.objects
.filter(end_date__gte=timezone.now())
.exclude(state="TESTING")
.prefetch_related("rewards")
.order_by("-start_date")
)
return render(