timezone stuff
[turniej.git] / apps / poetry / views.py
index 06c95a2..71309d7 100644 (file)
@@ -20,6 +20,7 @@ def poem(request, slug):
 def poet(request, slug):
     poet = get_object_or_404(Poet, slug=slug)
     last = poet.poem_set.order_by('-created_at')[:20]
+    in_contest = poet.poem_set.filter(in_contest=True).order_by('created_at')
     return render(request, "poetry/poet.html", locals())
 
 
@@ -27,3 +28,9 @@ def main(request):
     poets = Poet.objects.all().order_by('?')
     last = Poem.objects.all().order_by('-created_at')[:20]
     return render(request, "poetry/main.html", locals())
+
+
+def contest(request):
+    poets = Poet.objects.all().order_by('?')
+    return render(request, "poetry/contest.html", locals())
+