2016-05-26 02:34:10 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.conf import settings
|
2018-10-06 12:35:49 +02:00
|
|
|
from django.db import migrations, models
|
2016-05-26 02:34:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
2016-05-26 02:34:10 +02:00
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="Attribution",
|
2016-05-26 02:34:10 +02:00
|
|
|
fields=[
|
2018-10-06 12:35:49 +02:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("given", models.BooleanField(default=False, verbose_name="Donn\xe9e")),
|
2016-05-26 02:34:10 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="ChoixSpectacle",
|
2016-05-26 02:34:10 +02:00
|
|
|
fields=[
|
2018-10-06 12:35:49 +02:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"priority",
|
|
|
|
models.PositiveIntegerField(verbose_name=b"Priorit\xc3\xa9"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"double_choice",
|
|
|
|
models.CharField(
|
|
|
|
default=b"1",
|
|
|
|
max_length=10,
|
|
|
|
verbose_name=b"Nombre de places",
|
|
|
|
choices=[
|
|
|
|
(b"1", b"1 place"),
|
|
|
|
(b"autoquit", b"2 places si possible, 1 sinon"),
|
|
|
|
(b"double", b"2 places sinon rien"),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
],
|
|
|
|
options={
|
2018-10-06 12:35:49 +02:00
|
|
|
"ordering": ("priority",),
|
|
|
|
"verbose_name": "voeu",
|
|
|
|
"verbose_name_plural": "voeux",
|
2016-05-26 02:34:10 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="Participant",
|
2016-05-26 02:34:10 +02:00
|
|
|
fields=[
|
2018-10-06 12:35:49 +02:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("paid", models.BooleanField(default=False, verbose_name="A pay\xe9")),
|
|
|
|
(
|
|
|
|
"paymenttype",
|
|
|
|
models.CharField(
|
|
|
|
blank=True,
|
|
|
|
max_length=6,
|
|
|
|
verbose_name="Moyen de paiement",
|
|
|
|
choices=[
|
|
|
|
(b"cash", "Cash"),
|
|
|
|
(b"cb", b"CB"),
|
|
|
|
(b"cheque", "Ch\xe8que"),
|
|
|
|
(b"autre", "Autre"),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="Salle",
|
2016-05-26 02:34:10 +02:00
|
|
|
fields=[
|
2018-10-06 12:35:49 +02:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=300, verbose_name=b"Nom")),
|
|
|
|
("address", models.TextField(verbose_name=b"Adresse")),
|
2016-05-26 02:34:10 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="Spectacle",
|
2016-05-26 02:34:10 +02:00
|
|
|
fields=[
|
2018-10-06 12:35:49 +02:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("title", models.CharField(max_length=300, verbose_name=b"Titre")),
|
|
|
|
("date", models.DateTimeField(verbose_name=b"Date & heure")),
|
|
|
|
(
|
|
|
|
"description",
|
|
|
|
models.TextField(verbose_name=b"Description", blank=True),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"slots_description",
|
|
|
|
models.TextField(
|
|
|
|
verbose_name=b"Description des places", blank=True
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"price",
|
|
|
|
models.FloatField(verbose_name=b"Prix d'une place", blank=True),
|
|
|
|
),
|
|
|
|
("slots", models.IntegerField(verbose_name=b"Places")),
|
|
|
|
(
|
|
|
|
"priority",
|
|
|
|
models.IntegerField(default=1000, verbose_name=b"Priorit\xc3\xa9"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"location",
|
|
|
|
models.ForeignKey(to="bda.Salle", on_delete=models.CASCADE),
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
],
|
|
|
|
options={
|
2018-10-06 12:35:49 +02:00
|
|
|
"ordering": ("priority", "date", "title"),
|
|
|
|
"verbose_name": "Spectacle",
|
2016-05-26 02:34:10 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="participant",
|
|
|
|
name="attributions",
|
|
|
|
field=models.ManyToManyField(
|
|
|
|
related_name="attributed_to",
|
|
|
|
through="bda.Attribution",
|
|
|
|
to="bda.Spectacle",
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="participant",
|
|
|
|
name="choices",
|
|
|
|
field=models.ManyToManyField(
|
|
|
|
related_name="chosen_by",
|
|
|
|
through="bda.ChoixSpectacle",
|
|
|
|
to="bda.Spectacle",
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="participant",
|
|
|
|
name="user",
|
|
|
|
field=models.OneToOneField(
|
|
|
|
to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="choixspectacle",
|
|
|
|
name="participant",
|
|
|
|
field=models.ForeignKey(to="bda.Participant", on_delete=models.CASCADE),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="choixspectacle",
|
|
|
|
name="spectacle",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
related_name="participants",
|
|
|
|
to="bda.Spectacle",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="attribution",
|
|
|
|
name="participant",
|
|
|
|
field=models.ForeignKey(to="bda.Participant", on_delete=models.CASCADE),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-06 12:35:49 +02:00
|
|
|
model_name="attribution",
|
|
|
|
name="spectacle",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
related_name="attribues", to="bda.Spectacle", on_delete=models.CASCADE
|
|
|
|
),
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
2018-10-06 12:35:49 +02:00
|
|
|
name="choixspectacle", unique_together=set([("participant", "spectacle")])
|
2016-05-26 02:34:10 +02:00
|
|
|
),
|
|
|
|
]
|