Answer the question
In order to leave comments, you need to log in
Django, how to get rid of duplicates in comments?
in the ListView I show the last comments to the entry, as a result, there are duplicates.
{% for publisher in object_list %}
{% get_comment_list for mk.mk publisher.pk as comment_list %}
Where is the right place to specify select_related?
Answer the question
In order to leave comments, you need to log in
Apparently your django_comments are being retrieved in the get_comment_list method (probably a template tag).
Is this a self-written method or did you install some package? If self-written, then in it, and if the method is from a package, then I would take its code and transfer it to my template tag, where I would already prefetch all the necessary related objects
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question