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 157 forks source link

How to paginate comments? #160

Open kennethkth opened 4 years ago

kennethkth commented 4 years ago

Loading entire comments together doesn't seem to be the best idea. I was wondering if there is a way to paginate the comments? I looked through the documentation but couldn't find it.

danirus commented 4 years ago

It's not implemented yet. I mark it as feature request. Thanks @kennethkth!

danirus commented 4 years ago

Please, leave the issue open so that I don’t forget the request.

ebernardino01 commented 3 years ago

May I know when will the feature be available? Planning to integrate this with our app and eventually the comments will increase as the application gets more users. Btw we will adopt the web API for our implementation, so this feature will be very useful.

danirus commented 3 years ago

It won't be available in v2 but for v3. It is already in branch rel-3.0.0. But it's not backwards compatible, and it doesn't have a JavaScript interface yet.

It's not backwards compatible because it doesn't use the comment tree anymore. There is a new render_xtdcomment_list template tag that mirrors the render_comment_list from django-comments adding what is needed to display comment threads, including the paginator. If you don't need the frontend code, maybe you can use rel-3.0.0. It doesn't have enough tests yet. There is a new demo directory with a sample project and an install.sh file to set it up. It shows paginated comments.

I hope to finish v3 before 2022, I have very little time available.