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

211 lines
7.3 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
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 = [
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="Assignment",
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",
),
),
("title", models.CharField(max_length=100)),
("description", models.TextField(blank=True)),
("open_posts", models.PositiveSmallIntegerField()),
(
"poll_description_default",
models.CharField(blank=True, max_length=79),
),
(
"phase",
models.IntegerField(
choices=[
(0, "Searching for candidates"),
(1, "Voting"),
(2, "Finished"),
],
default=0,
),
),
2015-06-29 13:23:19 +02:00
],
options={
2019-01-06 16:22:33 +01:00
"verbose_name": "Election",
"default_permissions": (),
"permissions": (
("can_see", "Can see elections"),
("can_nominate_other", "Can nominate another participant"),
("can_nominate_self", "Can nominate oneself"),
("can_manage", "Can manage elections"),
),
"ordering": ("title",),
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="AssignmentOption",
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",
),
),
(
"candidate",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
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="AssignmentPoll",
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),
),
("published", models.BooleanField(default=False)),
("yesnoabstain", models.BooleanField(default=False)),
("description", models.CharField(blank=True, max_length=79)),
(
"assignment",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="polls",
to="assignments.Assignment",
),
),
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="AssignmentRelatedUser",
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",
),
),
("elected", models.BooleanField(default=False)),
(
"assignment",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="assignment_related_users",
to="assignments.Assignment",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
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="AssignmentVote",
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,
related_name="votes",
to="assignments.AssignmentOption",
),
),
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="assignmentoption",
name="poll",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="options",
to="assignments.AssignmentPoll",
),
2015-06-29 13:23:19 +02:00
),
migrations.AddField(
2019-01-06 16:22:33 +01:00
model_name="assignment",
name="related_users",
field=models.ManyToManyField(
through="assignments.AssignmentRelatedUser", 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="assignment",
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="assignmentrelateduser", unique_together=set([("assignment", "user")])
2015-06-29 13:23:19 +02:00
),
]