From f3b00796513fe97fe27f7a5ee124395fcaa195ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Fri, 2 Jun 2023 21:30:47 +0200 Subject: [PATCH] =?UTF-8?q?Tabulka=20odpov=C4=9Bd=C3=AD=20k=20V=C3=BDro?= =?UTF-8?q?=C4=8Dn=C3=ADmu=20srazu=20M&M?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vyroci/templates/vyroci/vyroci_list.html | 31 ++++++++++++++++++++++++ vyroci/urls.py | 8 +++++- vyroci/views.py | 7 +++++- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 vyroci/templates/vyroci/vyroci_list.html diff --git a/vyroci/templates/vyroci/vyroci_list.html b/vyroci/templates/vyroci/vyroci_list.html new file mode 100644 index 00000000..3f3a44ba --- /dev/null +++ b/vyroci/templates/vyroci/vyroci_list.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} + +{% block content %} + +

{% block nadpis1a %}M&Mí 30! odpovědi{% endblock nadpis1a %}

+ + + + + + + + + + + + + {% for obj in ucastnikvyroci_list %} + + + + + + + + + + {% endfor %} +
JménoPřezdívkaE-mailKdy účastník/orgCo znamená M&M?Co znamená číslo?Něco dodat?
{{ obj.jmeno }}{{ obj.prezdivka }}{{ obj.email }}{{ obj.kdy }}{{ obj.cojemam }}{{ obj.cislo }}{{ obj.dodat }}
+ +{% endblock content %} diff --git a/vyroci/urls.py b/vyroci/urls.py index ba5312eb..9b1ebfca 100644 --- a/vyroci/urls.py +++ b/vyroci/urls.py @@ -1,6 +1,7 @@ from django.urls import path -from .views import VyrociView +from seminar.utils import org_required +from .views import VyrociView, VyrociListView urlpatterns = [ path( @@ -8,4 +9,9 @@ urlpatterns = [ VyrociView.as_view(), name='vyrocni_sraz' ), + path( + 'sraz_vysledky/', + org_required(VyrociListView.as_view()), + name='vyrocni_sraz_vysledky' + ), ] diff --git a/vyroci/views.py b/vyroci/views.py index 9a60ff6e..40d87302 100644 --- a/vyroci/views.py +++ b/vyroci/views.py @@ -1,4 +1,4 @@ -from django.views.generic import FormView +from django.views.generic import FormView, ListView from seminar.models import Osoba from seminar.views import formularOKView @@ -29,3 +29,8 @@ class VyrociView(FormView): initial["jmeno"] = osoba.plne_jmeno() initial["email"] = osoba.email return initial + + +class VyrociListView(ListView): + template_name = 'vyroci/vyroci_list.html' + model = UcastnikVyroci