X-Git-Url: https://git.mdrn.pl/turniej.git/blobdiff_plain/3dbaa20d66d533211dc34746150cbb31f5afd5d3..0968cfbe5012ab5fe8eae41d0dd370b9c99678ca:/apps/poetry/views.py?ds=inline diff --git a/apps/poetry/views.py b/apps/poetry/views.py index 06c95a2..71309d7 100644 --- a/apps/poetry/views.py +++ b/apps/poetry/views.py @@ -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()) +