2015-05-02 15:00:15 +00:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
2015-05-02 17:00:38 +00:00
|
|
|
from django.shortcuts import get_object_or_404, render
|
|
|
|
|
2015-05-02 15:42:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
from .models import Message
|
|
|
|
|
|
|
|
|
2015-05-02 17:00:38 +00:00
|
|
|
def detail(request):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def detail(request, message_id):
|
|
|
|
p = get_object_or_404(Message, pk=message_id)
|
|
|
|
|
|
|
|
context = { 'message': p, }
|
|
|
|
return render(request, 'digital_glarus/detail.html', context)
|
|
|
|
|
2015-05-02 15:42:04 +00:00
|
|
|
def send_message(request):
|
|
|
|
pass
|
2015-05-02 15:15:20 +00:00
|
|
|
|
|
|
|
def index(request):
|
2015-05-02 15:42:04 +00:00
|
|
|
message_list = Message.objects.order_by('-received_date')[:5]
|
|
|
|
context = { 'message_list': message_list, }
|
|
|
|
return render(request, 'digital_glarus/index.html', context)
|