I want to calculate count of approved comments?
news_list = News.objects.all()\
.annotate(
comments_count=Count(
'comments__id',
comments__status=COMMENT_STATUS_APPROVED
)
)
But the second condition of Count-function is not working. How to filter annotate-function