Browse Source

soustredeni +action zverejnit soustredeni

remotes/origin/vysl deploy-test-2015-07-03-10-54-xlfd
Bc. Petr Pecha 10 years ago
parent
commit
f2bdb970ab
  1. 7
      seminar/admin.py

7
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)

Loading…
Cancel
Save