Text k soustredeni
This commit is contained in:
parent
9cbbfeaa95
commit
fad81991ec
3 changed files with 30 additions and 1 deletions
|
@ -260,9 +260,16 @@ admin.site.register(Problem, ProblemAdmin)
|
||||||
|
|
||||||
### Soustredeni
|
### Soustredeni
|
||||||
|
|
||||||
|
class SoustredeniAdminForm(forms.ModelForm):
|
||||||
|
text = forms.CharField(widget=CKEditorWidget())
|
||||||
|
class Meta:
|
||||||
|
model = Soustredeni
|
||||||
|
exclude = []
|
||||||
|
|
||||||
class SoustredeniAdmin(reversion.VersionAdmin):
|
class SoustredeniAdmin(reversion.VersionAdmin):
|
||||||
|
form = SoustredeniAdminForm
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None, {'fields': ['rocnik', 'misto', 'verejne_db']}),
|
(None, {'fields': ['rocnik', 'misto', 'verejne_db', 'text']}),
|
||||||
(u'Data', {'fields': ['datum_zacatku', 'datum_konce']}),
|
(u'Data', {'fields': ['datum_zacatku', 'datum_konce']}),
|
||||||
]
|
]
|
||||||
list_display = ['rocnik', 'misto', 'datum_zacatku', 'verejne']
|
list_display = ['rocnik', 'misto', 'datum_zacatku', 'verejne']
|
||||||
|
|
20
seminar/migrations/0015_soustredeni_text.py
Normal file
20
seminar/migrations/0015_soustredeni_text.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('seminar', '0014_uprava_poznamek'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='soustredeni',
|
||||||
|
name='text',
|
||||||
|
field=models.TextField(default=b'', verbose_name='text k soust\u0159ed\u011bn\xed (HTML)', blank=True),
|
||||||
|
preserve_default=True,
|
||||||
|
),
|
||||||
|
]
|
|
@ -498,6 +498,8 @@ class Soustredeni(SeminarModelBase):
|
||||||
ucastnici = models.ManyToManyField(Resitel, verbose_name=u'účastníci soustředění',
|
ucastnici = models.ManyToManyField(Resitel, verbose_name=u'účastníci soustředění',
|
||||||
help_text=u'Seznam účastníků soustředění', through='Soustredeni_Ucastnici')
|
help_text=u'Seznam účastníků soustředění', through='Soustredeni_Ucastnici')
|
||||||
|
|
||||||
|
text = models.TextField(u'text k soustředění (HTML)', blank=True, default='')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return force_unicode(u'%s (%s)' % (self.misto, self.datum_zacatku))
|
return force_unicode(u'%s (%s)' % (self.misto, self.datum_zacatku))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue