Commit 8b2e31ca authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add multilang for description and fix order of fields in admin

parent b6a420f2
......@@ -53,6 +53,10 @@ class RegistrationInformationFieldInline(admin.StackedInline):
@admin.register(models.Event)
class EventAdmin(DoNextModelAdmin):
inlines = (RegistrationInformationFieldInline,)
fields = ('title', 'description', 'start', 'end', 'organiser',
'registration_start', 'registration_end', 'cancel_deadline',
'location', 'map_location', 'price', 'cost',
'max_participants', 'no_registration_message', 'published')
list_display = ('overview_link', 'start', 'registration_start',
'num_participants', 'organiser', 'published', 'edit_link')
list_display_links = ('edit_link',)
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-21 20:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0005_auto_20160914_2154'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='description',
),
migrations.AddField(
model_name='event',
name='description_en',
field=models.TextField(default='', verbose_name='description (EN)'),
preserve_default=False,
),
migrations.AddField(
model_name='event',
name='description_nl',
field=models.TextField(default='', verbose_name='description (NL)'),
preserve_default=False,
),
]
......@@ -18,7 +18,10 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
max_length=100
)
description = models.TextField(_("description"))
description = MultilingualField(
models.TextField,
_("description")
)
start = models.DateTimeField(_("start time"))
......
......@@ -18,7 +18,8 @@ class RegistrationTest(TestCase):
self.event = Event.objects.create(
title_nl='testevene',
title_en='testevent',
description='desc',
description_en='desc',
description_nl='besch',
start=timezone.now(),
end=(timezone.now() + datetime.timedelta(hours=1)),
location_en='test location',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment