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())
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())
+