~pidgeon690/pidge-groups/trunk

« back to all changes in this revision

Viewing changes to Apps/Discuss/views.py

  • Committer: Fergus Ross Ferrier
  • Date: 2009-05-25 22:10:29 UTC
  • mfrom: (273.2.4 refactor+user)
  • Revision ID: hello@fergusrossferrier.co.uk-20090525221029-gqdycg3rfhxujqpz
Merged user-refactor fun.

Show diffs side-by-side

added added

removed removed

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