From bc9b55085f63dbcda2662b11579a8e2152f845ea Mon Sep 17 00:00:00 2001 From: LEdoian Date: Sun, 7 Dec 2025 02:00:56 +0000 Subject: [PATCH] =?UTF-8?q?Admin:=20akce=20na=20vy=C5=99e=C5=A1en=C3=AD=20?= =?UTF-8?q?probl=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