OpenSlides/openslides/agenda/migrations/0001_initial.py

69 lines
3.1 KiB
Python
Raw Normal View History

2016-03-02 01:29:47 +01:00
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 01:23
from __future__ import unicode_literals
2016-01-09 18:49:38 +01:00
import django.db.models.deletion
2015-06-29 13:23:19 +02:00
from django.conf import settings
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
2016-03-02 01:29:47 +01:00
initial = True
2015-06-29 13:23:19 +02:00
dependencies = [
2016-01-09 18:49:38 +01:00
('contenttypes', '0002_remove_content_type_name'),
2016-03-02 01:29:47 +01:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2015-06-29 13:23:19 +02:00
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
2016-03-02 01:29:47 +01:00
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2016-01-09 18:49:38 +01:00
('item_number', models.CharField(blank=True, max_length=255)),
2016-03-02 01:29:47 +01:00
('comment', models.TextField(blank=True, null=True)),
2016-01-09 18:49:38 +01:00
('closed', models.BooleanField(default=False)),
2016-03-02 01:29:47 +01:00
('type', models.IntegerField(choices=[(1, 'Agenda item'), (2, 'Hidden item')], default=2)),
('duration', models.CharField(blank=True, max_length=5, null=True)),
('weight', models.IntegerField(default=10000)),
('object_id', models.PositiveIntegerField(blank=True, null=True)),
2016-01-09 18:49:38 +01:00
('speaker_list_closed', models.BooleanField(default=False)),
('content_type', models.ForeignKey(
2016-03-02 01:29:47 +01:00
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.ContentType')),
2016-01-09 18:49:38 +01:00
('parent', models.ForeignKey(
2016-03-02 01:29:47 +01:00
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='agenda.Item')),
2015-06-29 13:23:19 +02:00
],
options={
'permissions': (
2016-03-02 01:29:47 +01:00
('can_see', 'Can see agenda'),
('can_manage', 'Can manage agenda'),
2016-01-09 18:49:38 +01:00
('can_see_hidden_items', 'Can see hidden items and time scheduling of agenda')),
'default_permissions': (),
2015-06-29 13:23:19 +02:00
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='Speaker',
fields=[
2016-03-02 01:29:47 +01:00
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2015-06-29 13:23:19 +02:00
('begin_time', models.DateTimeField(null=True)),
('end_time', models.DateTimeField(null=True)),
('weight', models.IntegerField(null=True)),
2016-03-02 01:29:47 +01:00
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='speakers', to='agenda.Item')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
2015-06-29 13:23:19 +02:00
],
options={
'permissions': (('can_be_speaker', 'Can put oneself on the list of speakers'),),
2016-01-09 18:49:38 +01:00
'default_permissions': (),
2015-06-29 13:23:19 +02:00
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
2016-01-09 18:49:38 +01:00
migrations.AlterUniqueTogether(
name='item',
unique_together=set([('content_type', 'object_id')]),
),
2015-06-29 13:23:19 +02:00
]