Dalsi hromadne akce
This commit is contained in:
parent
0a49ace38c
commit
1498a461a0
2 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()]
|
||||
|
|
Loading…
Reference in a new issue