4👍
queryset=Poll.objects.annotate(count=Count('choice')).filter(
pub_date__lte=timezone.now, count__gt=0).order_by('-pub_date')[:5]
Source:stackexchange.com
4👍
queryset=Poll.objects.annotate(count=Count('choice')).filter(
pub_date__lte=timezone.now, count__gt=0).order_by('-pub_date')[:5]