1
from django.shortcuts import render_to_response
2
from django.template.loader import render_to_string
3
from Discuss.models import Conversation, Post
5
def AllConversations(request):
7
Show all conversations.
9
conversations = Conversation.objects.all().order_by("-created")
11
bc = [{'title': 'All Conversations'}]
12
return render_to_response("discuss-all", {'breadcrumb': bc, 'activetab': 'Discuss', 'conversations': conversations})
15
def OneConversation(request, conversationid):
17
Show a specific conversation.
19
conversationid - the id of the conversation
21
thisconversation = Conversation.objects.get(id = conversationid)
22
posts = Post.objects.filter(conversation = thisconversation)
24
bc = [{'title': thisconversation.title}]
25
return render_to_response("discuss-one", {'breadcrumb': bc, 'activetab': 'Discuss', 'conversation': thisconversation, 'posts': posts})