How to add filter(is_public=True)
to Question?
Category.objects.add_related_count(
Category.objects.filter(is_public=True),
Question,
'category',
'question_counts',
cumulative=True)
You can use the extra_filters=…
parameter of the .add_related_count(…)
method [Django-doc]:
Category.objects.add_related_count(
Category.objects.filter(is_public=True),
Question,
'category',
'question_counts',
cumulative=True,
extra_filters={'is_public': True}
)