From 9d6d4891d002fbf9b68eeac9a58e37754ceaf578 Mon Sep 17 00:00:00 2001 From: LEdoian Date: Sun, 7 Dec 2025 02:00:36 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Admin:=20Filtr=20na=20probl=C3=A9my=20podle?= =?UTF-8?q?=20stavu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tvorba/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tvorba/admin.py b/tvorba/admin.py index 0e873c29..e7543d3c 100644 --- a/tvorba/admin.py +++ b/tvorba/admin.py @@ -144,6 +144,7 @@ class ProblemAdmin(PolymorphicParentModelAdmin): ] # Pokud chceme orezavat na aktualni rocnik, musime do modelu pridat odkaz na rocnik. Zatim bere vse. search_fields = ['nazev'] + list_filter = ['stav'] # V ProblemAdmin to nejde, protoze se to nepropise do deti -- 2.39.5 From bc9b55085f63dbcda2662b11579a8e2152f845ea Mon Sep 17 00:00:00 2001 From: LEdoian Date: Sun, 7 Dec 2025 02:00:56 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Admin:=20akce=20na=20vy=C5=99e=C5=A1en?= =?UTF-8?q?=C3=AD=20probl=C3=A9m=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tvorba/admin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tvorba/admin.py b/tvorba/admin.py index e7543d3c..9e9e8ae2 100644 --- a/tvorba/admin.py +++ b/tvorba/admin.py @@ -145,6 +145,11 @@ class ProblemAdmin(PolymorphicParentModelAdmin): # Pokud chceme orezavat na aktualni rocnik, musime do modelu pridat odkaz na rocnik. Zatim bere vse. search_fields = ['nazev'] list_filter = ['stav'] + actions = ['vyres_problemy'] + + @admin.action(description= 'Označit problémy jako vyřešené') + def vyres_problemy(self, req, qs): + qs.update(stav=Problem.STAV_VYRESENY) # V ProblemAdmin to nejde, protoze se to nepropise do deti -- 2.39.5