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

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