Added attachments to custom slides.

This commit is contained in:
Norman Jäckel 2016-01-09 10:18:51 +01:00 committed by Emanuel Schuetze
parent 8bdbdd0b07
commit 8a6ca904dc
4 changed files with 27 additions and 1 deletions

View File

@ -13,6 +13,7 @@ Agenda:
- Changed API of related objects. All assignments, motions and custom slides
are now agenda items and can be hidden.
- Removed mptt.
- Added attachments to custom slides.
Assignments:
- Renamed app from assignment to assignments.
- Removed possibility to block candidates.

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0004_auto_20151210_0016'),
('core', '0008_auto_20151210_0016'),
]
operations = [
migrations.AddField(
model_name='customslide',
name='attachments',
field=models.ManyToManyField(to='mediafiles.Mediafile', verbose_name='Attachments', blank=True),
),
]

View File

@ -5,6 +5,7 @@ from django.db import models
from django.utils.translation import ugettext_noop
from jsonfield import JSONField
from openslides.mediafiles.models import Mediafile
from openslides.utils.models import RESTModelMixin
from openslides.utils.projector import ProjectorElement
@ -127,6 +128,10 @@ class CustomSlide(RESTModelMixin, models.Model):
blank=True)
weight = models.IntegerField(
default=0)
attachments = models.ManyToManyField(
Mediafile,
verbose_name=ugettext_lazy('Attachments'),
blank=True)
class Meta:
default_permissions = ()

View File

@ -39,7 +39,7 @@ class CustomSlideSerializer(ModelSerializer):
"""
class Meta:
model = CustomSlide
fields = ('id', 'title', 'text', 'weight', 'agenda_item_id')
fields = ('id', 'title', 'text', 'weight', 'attachments', 'agenda_item_id')
class TagSerializer(ModelSerializer):