def count_comments_handler(sender, **kwargs):
    comment = kwargs['comment']
    if comment.is_public:
        entry = comment.content_object
        if isinstance(entry, Entry):
            entry.comment_count = F('comment_count') + 1
            entry.save(update_fields=['comment_count'])
Update Entry.comment_count when a public comment was posted.
dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/signals.py/count_comments_handler