mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
23 lines
546 B
Python
23 lines
546 B
Python
from django.shortcuts import render_to_response, get_object_or_404
|
|
|
|
from pgweb.util.contexts import NavContext
|
|
|
|
from datetime import date
|
|
|
|
from models import PwnPost
|
|
|
|
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'))
|