def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context.update({ # 'comment_list':Comment.get_by_target(self.request.path) 'comment_list': Comment.get_by_target_id(self.kwargs.get(self.pk_url_kwarg)), }) return context