From f2bdb970ab06e6f080856a910dbd1acec125a7f1 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Fri, 3 Jul 2015 10:54:13 +0200 Subject: [PATCH] soustredeni +action zverejnit soustredeni --- seminar/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/seminar/admin.py b/seminar/admin.py index 6ca5d238..9036592f 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -298,6 +298,12 @@ create_modeladmin(ProblemZadanyAdmin, Problem, 'ProblemZadany', verbose_name=u'P ### Soustredeni +def zverejnit_soustredeni(modeladmin, request, queryset): + for soustredeni in queryset: + soustredeni.verejne_db = True + soustredeni.save() +zverejnit_soustredeni.short_description = 'Zveřejnit soustředění' + class SoustredeniAdminForm(forms.ModelForm): text = forms.CharField(widget=CKEditorWidget(), required=False, **field_labels(Soustredeni, 'text')) class Meta: @@ -314,6 +320,7 @@ class SoustredeniAdmin(reversion.VersionAdmin): inlines = [Soustredeni_UcastniciInline] list_filter = ['rocnik'] view_on_site = Soustredeni.verejne_url + actions = [zverejnit_soustredeni,] admin.site.register(Soustredeni, SoustredeniAdmin)