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 - Changed API of related objects. All assignments, motions and custom slides
are now agenda items and can be hidden. are now agenda items and can be hidden.
- Removed mptt. - Removed mptt.
- Added attachments to custom slides.
Assignments: Assignments:
- Renamed app from assignment to assignments. - Renamed app from assignment to assignments.
- Removed possibility to block candidates. - 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 django.utils.translation import ugettext_noop
from jsonfield import JSONField from jsonfield import JSONField
from openslides.mediafiles.models import Mediafile
from openslides.utils.models import RESTModelMixin from openslides.utils.models import RESTModelMixin
from openslides.utils.projector import ProjectorElement from openslides.utils.projector import ProjectorElement
@ -127,6 +128,10 @@ class CustomSlide(RESTModelMixin, models.Model):
blank=True) blank=True)
weight = models.IntegerField( weight = models.IntegerField(
default=0) default=0)
attachments = models.ManyToManyField(
Mediafile,
verbose_name=ugettext_lazy('Attachments'),
blank=True)
class Meta: class Meta:
default_permissions = () default_permissions = ()

View File

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