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ší.




')