+ def comments_view(self, request, object_id):
+ model = self.model
+ opts = model._meta
+ obj = get_object_or_404(model, pk=object_id)
+
+ comments = ThreadedComment.objects.get_tree(obj)
+ # Annotate each comment with a proper reply form
+ for comment in comments:
+ initial = { 'comment' : quote_reply(comment) }
+ comment.reply_form = get_influence_comment_form(request.user.is_staff, comment)(initial=initial)
+
+ context = {
+ 'root_path' : self.admin_site.root_path,
+ 'app_label' : self.model._meta.app_label,
+ 'object' : obj,
+ 'opts' : opts,
+ 'comments' : comments,
+ 'media' : mark_safe(self.media),
+ }
+ return render_to_response('admin/influences/influence/comments.html', context, RequestContext(request))
+
+admin.site.register(Influence, InfluenceAdmin)