danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 158 forks source link

How to get comment count for an individual object #192

Closed jimkring closed 3 years ago

jimkring commented 4 years ago

I see here in the docs that we can get the comment count for a specific model (object type)

{% get_xtdcomment_count as [varname] for [app].[model] [[app].[model] ...] %}

I'm trying to get the comment count for an individual object. I'm thinking that I may need to implement that myself, since I don't see it readily in any of the template tags.

Any good solution for this?

rgutierrez-cotech commented 4 years ago

You have to use the template tag from django-contrib-comments, which is

{% get_comment_count for object [as varname] %}
danirus commented 3 years ago

Thanks for your answer, @rgutierrez-cotech. I think it solves the question. I enabled Discussions in this repository. It seems better to handle this kind of questions. I'm closing this issue now. If you need to reopen it, please, post it in Discussions. Thank you!