Browse Source

Text k soustredeni

remotes/origin/feincms
Tomas Gavenciak 10 years ago
parent
commit
fad81991ec
  1. 9
      seminar/admin.py
  2. 20
      seminar/migrations/0015_soustredeni_text.py
  3. 2
      seminar/models.py

9
seminar/admin.py

@ -260,9 +260,16 @@ admin.site.register(Problem, ProblemAdmin)
### Soustredeni
class SoustredeniAdminForm(forms.ModelForm):
text = forms.CharField(widget=CKEditorWidget())
class Meta:
model = Soustredeni
exclude = []
class SoustredeniAdmin(reversion.VersionAdmin):
form = SoustredeniAdminForm
fieldsets = [
(None, {'fields': ['rocnik', 'misto', 'verejne_db']}),
(None, {'fields': ['rocnik', 'misto', 'verejne_db', 'text']}),
(u'Data', {'fields': ['datum_zacatku', 'datum_konce']}),
]
list_display = ['rocnik', 'misto', 'datum_zacatku', 'verejne']

20
seminar/migrations/0015_soustredeni_text.py

@ -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,
),
]

2
seminar/models.py

@ -498,6 +498,8 @@ class Soustredeni(SeminarModelBase):
ucastnici = models.ManyToManyField(Resitel, verbose_name=u'účastníci soustředění',
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):
return force_unicode(u'%s (%s)' % (self.misto, self.datum_zacatku))

Loading…
Cancel
Save