Files
postgres-web/pgweb/pwn/views.py
Magnus Hagander 93d3450213 Add app to store and view the PostgreSQL Weekly News, including generation
of the RSS feed. (Which will receive a new URL now that it lives in the
actual app and not in with the static files, so a redirect will be needed
there).
2010-06-10 20:43:54 +02:00

24 lines
608 B
Python

from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseRedirect
from pgweb.util.contexts import NavContext
from datetime import date
from models import *
def index(request):
posts = PwnPost.objects.all()
return render_to_response('pwn/list.html', {
'posts': posts,
}, NavContext(request, 'community'))
def post(request, year, month, day):
d = date(int(year), int(month), int(day))
post = get_object_or_404(PwnPost, date=d)
return render_to_response('pwn/view.html', {
'post': post,
}, NavContext(request, 'community'))