Merge pull request 'Přidání CKEditoru do Soustředění a Novinek (#1294)' (!75) from ckeditor-dalsi-veci into master
Reviewed-on: #75
This commit is contained in:
commit
f0fbd8021f
2 changed files with 28 additions and 2 deletions
|
@ -1,5 +1,20 @@
|
|||
import django.forms
|
||||
from django.contrib import admin
|
||||
|
||||
from ckeditor_uploader.widgets import CKEditorUploadingWidget
|
||||
|
||||
from .models import Novinky
|
||||
|
||||
admin.site.register(Novinky)
|
||||
|
||||
class NovinkyAdminForm(django.forms.ModelForm):
|
||||
class Meta:
|
||||
model = Novinky
|
||||
widgets = {
|
||||
'text': CKEditorUploadingWidget,
|
||||
}
|
||||
fields = '__all__'
|
||||
|
||||
@admin.register(Novinky)
|
||||
class NovinkyAdmin(admin.ModelAdmin):
|
||||
form = NovinkyAdminForm
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import django.forms
|
||||
from django.contrib import admin
|
||||
from django.forms import widgets
|
||||
from django.db import models
|
||||
|
||||
from ckeditor_uploader.widgets import CKEditorUploadingWidget
|
||||
|
||||
import soustredeni.models as m
|
||||
|
||||
|
||||
|
@ -35,9 +38,17 @@ class SoustredeniOrganizatoriInline(admin.TabularInline):
|
|||
return qs.select_related('organizator', 'soustredeni')
|
||||
|
||||
|
||||
class SoustredeniAdminForm(django.forms.ModelForm):
|
||||
class Meta:
|
||||
model = m.Soustredeni
|
||||
widgets = {
|
||||
'text': CKEditorUploadingWidget,
|
||||
}
|
||||
fields = '__all__'
|
||||
|
||||
@admin.register(m.Soustredeni)
|
||||
class SoustredeniAdmin(admin.ModelAdmin):
|
||||
model = m.Soustredeni
|
||||
form = SoustredeniAdminForm
|
||||
inline_type = 'tabular'
|
||||
inlines = [SoustredeniUcastniciInline, SoustredeniOrganizatoriInline]
|
||||
|
||||
|
|
Loading…
Reference in a new issue