From 1498a461a04fc2966c941e6309910d2f76e69c53 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Thu, 23 Jul 2015 21:57:23 +0200 Subject: [PATCH] Dalsi hromadne akce --- seminar/admin.py | 11 +++++++++++ seminar/models.py | 1 + 2 files changed, 12 insertions(+) diff --git a/seminar/admin.py b/seminar/admin.py index 5db102d7..8e189cbf 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -201,6 +201,13 @@ class CisloAdmin(reversion.VersionAdmin): list_display = ['kod', 'rocnik', 'cislo', 'datum_vydani', 'datum_deadline', 'verejne', 'verejna_vysledkovka'] list_filter = ['rocnik'] view_on_site = Cislo.verejne_url + actions = [ + make_set_action('verejne_db', True, u'Zveřejnit číslo'), + make_set_action('verejne_db', False, u'Skrýt (zneveřejnit) číslo'), + make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'), + make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'), + ] + def get_queryset(self, request): qs = super(CisloAdmin, self).get_queryset(request) return qs.select_related('rocnik') @@ -216,6 +223,10 @@ class RocnikAdmin(reversion.VersionAdmin): list_display = ['rocnik', 'prvni_rok', 'exportovat', 'verejne'] inlines = [CisloInline] view_on_site = Rocnik.verejne_url + actions = [ + make_set_action('exportovat', True, u'Nastavit pro AESOP export'), + make_set_action('exportovat', False, u'Skrýt pro AESOP export'), + ] admin.site.register(Rocnik, RocnikAdmin) diff --git a/seminar/models.py b/seminar/models.py index 44ecb828..a11c9393 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -266,6 +266,7 @@ class Rocnik(SeminarModelBase): def verejne(self): return len(self.verejna_cisla()) > 0 verejne.boolean = True + verejne.short_description = u'Veřejný (jen dle čísel)' def verejna_cisla(self): vc = [c for c in self.cisla.all() if c.verejne()]