soustredeni +action zverejnit soustredeni
This commit is contained in:
parent
808351fad0
commit
f2bdb970ab
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue