def thread_list(request, pk): """ Listing of threads in a forum. """ threads = Thread.objects.filter(forum=pk).order_by("-created") threads = make_paginator(request, threads, 20) return render_to_response("forum/forum.html", add_csrf(request, threads=threads, pk=pk))
def get(self, request, post_type, pk): # url パスを見てフォームの着地点を決める。 if post_type == "new_thread": form_action = reverse('create_thread_view', args=[pk]) title = "Start New Topic" subject = '' elif post_type == "reply": form_action = reverse('create_post_reply_view', args=[pk]) title = "Reply" subject = "Re: " + Thread.objects.get(pk=pk).title context = { 'title': title, 'subject': subject, 'action': form_action, } return render_to_response('forum/new_posting.html', add_csrf(self.request, **context))