From e58956484070109442a97c40f80ab17f20efd900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 16 Oct 2023 19:55:37 +0200 Subject: [PATCH] =?UTF-8?q?(sifrovacka)=20odli=C5=A1en=C3=AD=20p=C5=99ijmu?= =?UTF-8?q?t=C3=BDch=20a=20nep=C5=99ijmut=C3=BDch=20odpov=C4=9Bd=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0003_odpoveducastnika_uspech.py | 18 ++++++++++++++++++ sifrovacka/models.py | 1 + .../templates/sifrovacka/odpovedi_list.html | 2 +- sifrovacka/views.py | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sifrovacka/migrations/0003_odpoveducastnika_uspech.py diff --git a/sifrovacka/migrations/0003_odpoveducastnika_uspech.py b/sifrovacka/migrations/0003_odpoveducastnika_uspech.py new file mode 100644 index 00000000..1d61dd8c --- /dev/null +++ b/sifrovacka/migrations/0003_odpoveducastnika_uspech.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.22 on 2023-10-16 17:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sifrovacka', '0002_auto_20231015_1944'), + ] + + operations = [ + migrations.AddField( + model_name='odpoveducastnika', + name='uspech', + field=models.BooleanField(default=False, verbose_name='Úspěch'), + ), + ] diff --git a/sifrovacka/models.py b/sifrovacka/models.py index 05dd6e4c..26c6c008 100644 --- a/sifrovacka/models.py +++ b/sifrovacka/models.py @@ -15,6 +15,7 @@ class OdpovedUcastnika(models.Model): odpoved = models.TextField("Tajenka bez diakritiky", blank=False, null=False,) sifra = models.IntegerField("Číslo šifry", blank=False, null=False,) timestamp = models.DateTimeField("Timestamp", blank=False, null=False, default=timezone.now) + uspech = models.BooleanField("Úspěch", blank=False, null=False, default=False) class SpravnaOdpoved(models.Model): diff --git a/sifrovacka/templates/sifrovacka/odpovedi_list.html b/sifrovacka/templates/sifrovacka/odpovedi_list.html index cc52a584..0024a7c1 100644 --- a/sifrovacka/templates/sifrovacka/odpovedi_list.html +++ b/sifrovacka/templates/sifrovacka/odpovedi_list.html @@ -17,7 +17,7 @@ {{ u.timestamp }} {{ u.resitel }} {{ u.sifra }} - {{ u.odpoved }} + {{ u.odpoved }} {% endfor %} diff --git a/sifrovacka/views.py b/sifrovacka/views.py index 91100e53..9c4af3ed 100644 --- a/sifrovacka/views.py +++ b/sifrovacka/views.py @@ -22,6 +22,9 @@ class SifrovackaView(FormView): if sifra is None: return formularOKView(self.request, f'

Bohužel vám hvězdy nebyly nakloněny. Rozumějte máte to blbě.

Zkusit znovu.




') + instance.uspech = True + instance.save() + return formularOKView(self.request, f'

{sifra.skryty_text}

Odevzdat další.




')