From 6ba9d5e3cb397f9708a722e15d094acb3e4a6cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 16 Oct 2023 17:23:46 +0200 Subject: [PATCH] =?UTF-8?q?Vyti=C5=A1t=C4=9Bn=C3=A9=20=C5=BE=C3=A1dosti=20?= =?UTF-8?q?v=20invent=C3=A1=C5=99i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hra/models.py | 4 ++++ hra/templates/hra/inventar.html | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hra/models.py b/hra/models.py index df79374..72cd2f7 100644 --- a/hra/models.py +++ b/hra/models.py @@ -131,6 +131,10 @@ class Tym(models.Model): def vyzvednute_zadosti(self) -> QuerySet["Zadost"]: return self.zadosti.filter(vyzvednuta=True) + @property + def vytistene_zadosti(self) -> QuerySet["Zadost"]: + return self.zadosti.filter(vytistena=True) + @property def nevyzvednute_zadosti(self) -> QuerySet["Zadost"]: return self.zadosti.filter(studijni__isnull=False, vyzvednuta=False) diff --git a/hra/templates/hra/inventar.html b/hra/templates/hra/inventar.html index 689ffd4..f446bad 100644 --- a/hra/templates/hra/inventar.html +++ b/hra/templates/hra/inventar.html @@ -16,6 +16,10 @@

{% for _ in ""|center:tym.ovesna_kase %}🥘{% endfor %}

{% endif %} +{% for zadost in tym.vytistene_zadosti %} +

Vytištěná {{ zadost }}

+{% endfor %} + {% for zadost in tym.vyzvednute_zadosti %}

{% if zadost.plati %}Kladná{% else %}Záporná{% endif %} odpověď na {{ zadost }}

{% endfor %}