2019-10-18 14:18:49 +02:00
|
|
|
# Generated by Django 2.2.6 on 2019-10-17 08:40
|
|
|
|
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
import django.core.validators
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
import openslides.utils.models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
("users", "0011_postgresql_auth_group_id_sequence"),
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
("assignments", "0007_assignment_attachments"),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name="assignmentoption", old_name="candidate", new_name="user"
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="global_abstain",
|
|
|
|
field=models.BooleanField(default=True),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="global_no",
|
|
|
|
field=models.BooleanField(default=True),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="groups",
|
|
|
|
field=models.ManyToManyField(blank=True, to="users.Group"),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="state",
|
|
|
|
field=models.IntegerField(
|
|
|
|
choices=[
|
|
|
|
(1, "Created"),
|
|
|
|
(2, "Started"),
|
|
|
|
(3, "Finished"),
|
|
|
|
(4, "Published"),
|
|
|
|
],
|
|
|
|
default=1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="title",
|
|
|
|
field=models.CharField(default="Poll", max_length=255, blank=True),
|
|
|
|
preserve_default=False,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="type",
|
|
|
|
field=models.CharField(
|
|
|
|
choices=[
|
|
|
|
("analog", "Analog"),
|
|
|
|
("named", "Named"),
|
|
|
|
("pseudoanonymous", "Pseudoanonymous"),
|
|
|
|
],
|
|
|
|
default="analog",
|
|
|
|
max_length=64,
|
|
|
|
),
|
|
|
|
preserve_default=False,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="votes_amount",
|
|
|
|
field=models.IntegerField(
|
|
|
|
default=1, validators=[django.core.validators.MinValueValidator(1)]
|
|
|
|
),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentvote",
|
|
|
|
name="user",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
blank=True,
|
|
|
|
default=None,
|
|
|
|
null=True,
|
|
|
|
on_delete=openslides.utils.models.SET_NULL_AND_AUTOUPDATE,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="allow_multiple_votes_per_candidate",
|
|
|
|
field=models.BooleanField(default=False),
|
|
|
|
),
|
2019-10-29 09:44:19 +01:00
|
|
|
migrations.AddField(
|
2019-10-18 14:18:49 +02:00
|
|
|
model_name="assignmentpoll",
|
2019-10-29 09:44:19 +01:00
|
|
|
name="majority_method",
|
2019-10-18 14:18:49 +02:00
|
|
|
field=models.CharField(
|
2019-10-29 09:44:19 +01:00
|
|
|
choices=[
|
|
|
|
("simple", "Simple majority"),
|
|
|
|
("two_thirds", "Two-thirds majority"),
|
|
|
|
("three_quarters", "Three-quarters majority"),
|
|
|
|
("disabled", "Disabled"),
|
|
|
|
],
|
|
|
|
default="",
|
|
|
|
max_length=14,
|
|
|
|
),
|
|
|
|
preserve_default=False,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="onehundred_percent_base",
|
|
|
|
field=models.CharField(
|
|
|
|
choices=[
|
|
|
|
("YN", "Yes/No per candidate"),
|
|
|
|
("YNA", "Yes/No/Abstain per candidate"),
|
|
|
|
("votes", "Sum of votes inclusive global ones"),
|
|
|
|
("valid", "All valid ballots"),
|
|
|
|
("cast", "All casted ballots"),
|
|
|
|
("disabled", "Disabled (no percents)"),
|
|
|
|
],
|
|
|
|
default="",
|
|
|
|
max_length=8,
|
2019-10-18 14:18:49 +02:00
|
|
|
),
|
2019-10-29 09:44:19 +01:00
|
|
|
preserve_default=False,
|
2019-10-18 14:18:49 +02:00
|
|
|
),
|
2019-11-12 09:20:10 +01:00
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignment",
|
|
|
|
name="number_poll_candidates",
|
|
|
|
field=models.BooleanField(default=False),
|
|
|
|
),
|
2020-02-12 17:18:01 +01:00
|
|
|
migrations.AddField(
|
|
|
|
model_name="assignmentoption",
|
|
|
|
name="voted",
|
|
|
|
field=models.ManyToManyField(
|
|
|
|
blank=True,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
related_name="assignmentoption_voted",
|
|
|
|
),
|
|
|
|
),
|
2019-10-18 14:18:49 +02:00
|
|
|
migrations.AlterField(
|
2019-10-29 09:44:19 +01:00
|
|
|
model_name="assignment",
|
|
|
|
name="poll_description_default",
|
|
|
|
field=models.CharField(blank=True, max_length=255),
|
|
|
|
),
|
2020-02-12 17:18:01 +01:00
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentoption",
|
|
|
|
name="poll",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=openslides.utils.models.CASCADE_AND_AUTOUPDATE,
|
|
|
|
related_name="options",
|
|
|
|
to="assignments.AssignmentPoll",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentvote",
|
|
|
|
name="option",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=openslides.utils.models.CASCADE_AND_AUTOUPDATE,
|
|
|
|
related_name="votes",
|
|
|
|
to="assignments.AssignmentOption",
|
|
|
|
),
|
|
|
|
),
|
2019-10-29 09:44:19 +01:00
|
|
|
migrations.RenameField(
|
|
|
|
model_name="assignment",
|
|
|
|
old_name="poll_description_default",
|
|
|
|
new_name="default_poll_description",
|
|
|
|
),
|
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="description",
|
|
|
|
field=models.CharField(blank=True, max_length=255),
|
|
|
|
),
|
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="pollmethod",
|
2019-10-18 14:18:49 +02:00
|
|
|
field=models.CharField(
|
2019-10-29 09:44:19 +01:00
|
|
|
choices=[("YN", "YN"), ("YNA", "YNA"), ("votes", "votes")], max_length=5
|
2019-10-18 14:18:49 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentvote",
|
|
|
|
name="weight",
|
|
|
|
field=models.DecimalField(
|
|
|
|
decimal_places=6,
|
|
|
|
default=Decimal("1"),
|
|
|
|
max_digits=15,
|
|
|
|
validators=[django.core.validators.MinValueValidator(Decimal("-2"))],
|
|
|
|
),
|
|
|
|
),
|
2020-02-12 17:18:01 +01:00
|
|
|
migrations.AlterField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
name="assignment",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=openslides.utils.models.CASCADE_AND_AUTOUPDATE,
|
|
|
|
related_name="polls",
|
|
|
|
to="assignments.Assignment",
|
|
|
|
),
|
|
|
|
),
|
2019-10-18 14:18:49 +02:00
|
|
|
migrations.RenameField(
|
|
|
|
model_name="assignmentpoll", old_name="votescast", new_name="db_votescast"
|
|
|
|
),
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name="assignmentpoll",
|
|
|
|
old_name="votesinvalid",
|
|
|
|
new_name="db_votesinvalid",
|
|
|
|
),
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name="assignmentpoll", old_name="votesvalid", new_name="db_votesvalid"
|
|
|
|
),
|
|
|
|
]
|