2016-03-02 01:29:47 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Generated by Django 1.9.2 on 2016-03-02 01:22
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2016-01-09 18:49:38 +01:00
|
|
|
import uuid
|
|
|
|
|
2016-03-02 01:29:47 +01:00
|
|
|
import django.db.models.deletion
|
2015-02-18 01:45:39 +01:00
|
|
|
import jsonfield.fields
|
2016-01-09 18:49:38 +01:00
|
|
|
from django.conf import settings
|
2015-02-18 01:45:39 +01:00
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
import openslides.utils.models
|
|
|
|
|
|
|
|
|
|
|
|
def add_default_projector(apps, schema_editor):
|
|
|
|
"""
|
2016-01-09 18:49:38 +01:00
|
|
|
Adds default projector and activates clock.
|
2015-02-18 01:45:39 +01:00
|
|
|
"""
|
|
|
|
# We get the model from the versioned app registry;
|
|
|
|
# if we directly import it, it will be the wrong version.
|
|
|
|
Projector = apps.get_model('core', 'Projector')
|
2016-01-09 18:49:38 +01:00
|
|
|
projector_config = {}
|
|
|
|
projector_config[uuid.uuid4().hex] = {
|
|
|
|
'name': 'core/clock',
|
|
|
|
'stable': True}
|
2015-02-18 01:45:39 +01:00
|
|
|
Projector.objects.create(config=projector_config)
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
2016-03-02 01:29:47 +01:00
|
|
|
initial = True
|
|
|
|
|
2015-02-18 01:45:39 +01:00
|
|
|
dependencies = [
|
2016-03-02 01:29:47 +01:00
|
|
|
('mediafiles', '0001_initial'),
|
2016-01-09 18:49:38 +01:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2015-02-18 01:45:39 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2016-01-09 18:49:38 +01:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='ChatMessage',
|
|
|
|
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
|
|
|
('message', models.TextField()),
|
|
|
|
('timestamp', models.DateTimeField(auto_now_add=True)),
|
2016-03-02 01:29:47 +01:00
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2016-01-09 18:49:38 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'default_permissions': (),
|
2016-03-02 01:29:47 +01:00
|
|
|
'permissions': (('can_use_chat', 'Can use the chat'),),
|
2016-01-09 18:49:38 +01:00
|
|
|
},
|
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ConfigStore',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('key', models.CharField(db_index=True, max_length=255, unique=True)),
|
2016-01-09 18:49:38 +01:00
|
|
|
('value', jsonfield.fields.JSONField()),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'default_permissions': (),
|
2016-03-02 01:29:47 +01:00
|
|
|
'permissions': (('can_manage_config', 'Can manage configuration'),),
|
2016-01-09 18:49:38 +01:00
|
|
|
},
|
|
|
|
),
|
2015-02-18 01:45:39 +01:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomSlide',
|
|
|
|
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
|
|
|
('title', models.CharField(max_length=256)),
|
|
|
|
('text', models.TextField(blank=True)),
|
|
|
|
('weight', models.IntegerField(default=0)),
|
2016-03-02 01:29:47 +01:00
|
|
|
('attachments', models.ManyToManyField(blank=True, to='mediafiles.Mediafile')),
|
2015-02-18 01:45:39 +01:00
|
|
|
],
|
|
|
|
options={
|
2016-01-09 18:49:38 +01:00
|
|
|
'default_permissions': (),
|
2015-02-18 01:45:39 +01:00
|
|
|
'ordering': ('weight', 'title'),
|
|
|
|
},
|
2015-06-29 12:08:15 +02:00
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
2015-02-18 01:45:39 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Projector',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
2015-02-18 01:45:39 +01:00
|
|
|
('config', jsonfield.fields.JSONField()),
|
2016-01-09 18:49:38 +01:00
|
|
|
('scale', models.IntegerField(default=0)),
|
|
|
|
('scroll', models.IntegerField(default=0)),
|
2015-02-18 01:45:39 +01:00
|
|
|
],
|
|
|
|
options={
|
2016-01-09 18:49:38 +01:00
|
|
|
'default_permissions': (),
|
2016-03-02 01:29:47 +01:00
|
|
|
'permissions': (
|
|
|
|
('can_see_projector', 'Can see the projector'),
|
|
|
|
('can_manage_projector', 'Can manage the projector'),
|
|
|
|
('can_see_frontpage', 'Can see the front page')),
|
2015-02-18 01:45:39 +01:00
|
|
|
},
|
2015-06-29 12:08:15 +02:00
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
2015-02-18 01:45:39 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Tag',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('name', models.CharField(max_length=255, unique=True)),
|
2015-02-18 01:45:39 +01:00
|
|
|
],
|
|
|
|
options={
|
2016-01-09 18:49:38 +01:00
|
|
|
'default_permissions': (),
|
2016-03-02 01:29:47 +01:00
|
|
|
'permissions': (('can_manage_tags', 'Can manage tags'),),
|
2016-01-09 18:49:38 +01:00
|
|
|
'ordering': ('name',),
|
2015-06-29 12:08:15 +02:00
|
|
|
},
|
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
|
|
|
),
|
2015-02-18 01:45:39 +01:00
|
|
|
migrations.RunPython(
|
2015-06-29 12:08:15 +02:00
|
|
|
code=add_default_projector,
|
|
|
|
reverse_code=None,
|
|
|
|
atomic=True,
|
2015-02-18 01:45:39 +01:00
|
|
|
),
|
|
|
|
]
|