comparison gpp/forums/views.py @ 87:515d1daec811

Forums: added intra-page links for posts. Added last_page variable for topic. Conditionally display reply form using last_page.
author Brian Neal <bgneal@gmail.com>
date Sat, 12 Sep 2009 18:45:35 +0000
parents f81226b5e87b
children 021492db4aad
comparison
equal deleted inserted replaced
86:f81226b5e87b 87:515d1daec811
58 topic = get_object_or_404(Topic, pk=id) 58 topic = get_object_or_404(Topic, pk=id)
59 topic.view_count += 1 59 topic.view_count += 1
60 topic.save() 60 topic.save()
61 61
62 posts = topic.posts.select_related() 62 posts = topic.posts.select_related()
63 last_page = True # TODO
63 64
64 return render_to_response('forums/topic.html', { 65 return render_to_response('forums/topic.html', {
65 'forum': topic.forum, 66 'forum': topic.forum,
66 'topic': topic, 67 'topic': topic,
67 'posts': posts, 68 'posts': posts,
69 'last_page': last_page,
68 'form': PostForm(), 70 'form': PostForm(),
69 }, 71 },
70 context_instance=RequestContext(request)) 72 context_instance=RequestContext(request))
71 73
72 74