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
|
|
|
|
|
2015-06-29 13:23:19 +02:00
|
|
|
import django.db.models.deletion
|
|
|
|
import jsonfield.fields
|
|
|
|
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
|
|
|
('mediafiles', '0001_initial'),
|
2016-03-02 01:29:47 +01:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2016-01-09 18:49:38 +01:00
|
|
|
('core', '0001_initial'),
|
2015-06-29 13:23:19 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Category',
|
|
|
|
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
|
|
|
('name', models.CharField(max_length=255)),
|
|
|
|
('prefix', models.CharField(blank=True, max_length=32)),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['prefix'],
|
2016-03-02 01:29:47 +01:00
|
|
|
'default_permissions': (),
|
2015-06-29 13:23:19 +02:00
|
|
|
},
|
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Motion',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('identifier', models.CharField(blank=True, max_length=255, null=True, unique=True)),
|
2015-06-29 13:23:19 +02:00
|
|
|
('identifier_number', models.IntegerField(null=True)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'Motion',
|
2016-03-02 01:29:47 +01:00
|
|
|
'permissions': (
|
|
|
|
('can_see', 'Can see motions'),
|
|
|
|
('can_create', 'Can create motions'),
|
|
|
|
('can_support', 'Can support motions'),
|
|
|
|
('can_manage', 'Can manage motions')),
|
2016-01-09 18:49:38 +01:00
|
|
|
'ordering': ('identifier',),
|
|
|
|
'default_permissions': (),
|
2015-06-29 13:23:19 +02:00
|
|
|
},
|
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MotionLog',
|
|
|
|
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
|
|
|
('message_list', jsonfield.fields.JSONField()),
|
|
|
|
('time', models.DateTimeField(auto_now=True)),
|
2016-03-02 01:29:47 +01:00
|
|
|
('motion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_messages', to='motions.Motion')),
|
|
|
|
('person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['-time'],
|
2016-03-02 01:29:47 +01:00
|
|
|
'default_permissions': (),
|
2015-06-29 13:23:19 +02:00
|
|
|
},
|
|
|
|
bases=(openslides.utils.models.RESTModelMixin, models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MotionOption',
|
|
|
|
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
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MotionPoll',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('votesvalid', openslides.utils.models.MinMaxIntegerField(blank=True, null=True)),
|
|
|
|
('votesinvalid', openslides.utils.models.MinMaxIntegerField(blank=True, null=True)),
|
|
|
|
('votescast', openslides.utils.models.MinMaxIntegerField(blank=True, null=True)),
|
|
|
|
('motion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='polls', to='motions.Motion')),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MotionVersion',
|
|
|
|
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
|
|
|
('version_number', models.PositiveIntegerField(default=1)),
|
2016-01-09 18:49:38 +01:00
|
|
|
('title', models.CharField(max_length=255)),
|
|
|
|
('text', models.TextField()),
|
2016-03-02 01:29:47 +01:00
|
|
|
('reason', models.TextField(blank=True, null=True)),
|
2015-06-29 13:23:19 +02:00
|
|
|
('creation_time', models.DateTimeField(auto_now=True)),
|
2016-03-02 01:29:47 +01:00
|
|
|
('motion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='motions.Motion')),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MotionVote',
|
|
|
|
fields=[
|
2016-03-02 01:29:47 +01:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('weight', models.IntegerField(default=1, null=True)),
|
|
|
|
('value', models.CharField(max_length=255, null=True)),
|
|
|
|
('option', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='motions.MotionOption')),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='State',
|
|
|
|
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
|
|
|
('name', models.CharField(max_length=255)),
|
|
|
|
('action_word', models.CharField(max_length=255)),
|
2016-01-09 18:49:38 +01:00
|
|
|
('css_class', models.CharField(default='primary', max_length=255)),
|
2015-06-29 13:23:19 +02:00
|
|
|
('required_permission_to_see', models.CharField(blank=True, max_length=255)),
|
|
|
|
('allow_support', models.BooleanField(default=False)),
|
|
|
|
('allow_create_poll', models.BooleanField(default=False)),
|
|
|
|
('allow_submitter_edit', models.BooleanField(default=False)),
|
|
|
|
('versioning', models.BooleanField(default=False)),
|
|
|
|
('leave_old_version_active', models.BooleanField(default=False)),
|
|
|
|
('dont_set_identifier', models.BooleanField(default=False)),
|
|
|
|
('next_states', models.ManyToManyField(to='motions.State')),
|
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Workflow',
|
|
|
|
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
|
|
|
('name', models.CharField(max_length=255)),
|
2016-01-09 18:49:38 +01:00
|
|
|
('first_state', models.OneToOneField(
|
2016-03-02 01:29:47 +01:00
|
|
|
null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='motions.State')),
|
2015-06-29 13:23:19 +02:00
|
|
|
],
|
|
|
|
options={
|
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),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='state',
|
|
|
|
name='workflow',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states', to='motions.Workflow'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motionoption',
|
|
|
|
name='poll',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='motions.MotionPoll'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='active_version',
|
|
|
|
field=models.ForeignKey(
|
2016-03-02 01:29:47 +01:00
|
|
|
null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='active_version', to='motions.MotionVersion'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='attachments',
|
2016-01-09 18:49:38 +01:00
|
|
|
field=models.ManyToManyField(blank=True, to='mediafiles.Mediafile'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='category',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.Category'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='parent',
|
2016-01-09 18:49:38 +01:00
|
|
|
field=models.ForeignKey(
|
2016-03-02 01:29:47 +01:00
|
|
|
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='amendments', to='motions.Motion'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='state',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.State'),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='submitters',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ManyToManyField(blank=True, related_name='motion_submitters', to=settings.AUTH_USER_MODEL),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='supporters',
|
2016-03-02 01:29:47 +01:00
|
|
|
field=models.ManyToManyField(blank=True, related_name='motion_supporters', to=settings.AUTH_USER_MODEL),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='motion',
|
|
|
|
name='tags',
|
2016-01-09 18:49:38 +01:00
|
|
|
field=models.ManyToManyField(blank=True, to='core.Tag'),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='motionversion',
|
|
|
|
unique_together=set([('motion', 'version_number')]),
|
2015-06-29 13:23:19 +02:00
|
|
|
),
|
|
|
|
]
|