django-comments-xtd icon indicating copy to clipboard operation
django-comments-xtd copied to clipboard

How to paginate comments?

Open kennethkth opened this issue 5 years ago • 4 comments

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.

kennethkth avatar May 31 '20 04:05 kennethkth

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

danirus avatar May 31 '20 04:05 danirus

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

danirus avatar May 31 '20 05:05 danirus

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.

ebernardino01 avatar Jun 01 '21 12:06 ebernardino01

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.

danirus avatar Jun 02 '21 06:06 danirus