Count supporters in the database - it's faster.
This commit is contained in:
parent
26682bc158
commit
fca73608c2
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ def view(request):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
context = {
|
context = {
|
||||||
'press_releases': PressRelease.objects.all().filter(pub_date__lte=now, sites=2)[:5],
|
'press_releases': PressRelease.objects.all().filter(pub_date__lte=now, sites=2)[:5],
|
||||||
'supporters_count': len(Supporter.objects.all().filter(display_until_date__gte=now)),
|
'supporters_count': Supporter.objects.all().filter(display_until_date__gte=now).count(),
|
||||||
'blog': BlogEntry.objects.all().filter(pub_date__lte=now)[:5],
|
'blog': BlogEntry.objects.all().filter(pub_date__lte=now)[:5],
|
||||||
}
|
}
|
||||||
return render_template_with_context(request, "frontpage.html", context)
|
return render_template_with_context(request, "frontpage.html", context)
|
||||||
|
|
Loading…
Reference in a new issue