gestioCOF/events/migrations/0003_options_and_extra_fields.py

200 lines
6.5 KiB
Python
Raw Normal View History

# Generated by Django 2.2.8 on 2019-12-22 14:54
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("events", "0002_event_subscribers"),
]
operations = [
migrations.CreateModel(
name="ExtraField",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(
max_length=200, verbose_name="champ d'événement supplémentaire"
),
),
(
"field_type",
models.CharField(
choices=[
("shorttext", "texte court (une ligne)"),
("longtext", "texte long (plusieurs lignes)"),
],
max_length=9,
verbose_name="type de champ",
),
),
],
),
migrations.CreateModel(
name="Option",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(max_length=200, verbose_name="option d'événement"),
),
(
"multi_choices",
models.BooleanField(default=False, verbose_name="choix multiples"),
),
],
options={
"verbose_name": "option d'événement",
"verbose_name_plural": "options d'événement",
},
),
migrations.CreateModel(
name="OptionChoice",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("choice", models.CharField(max_length=200, verbose_name="choix")),
(
"option",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="choices",
to="events.Option",
),
),
],
options={
"verbose_name": "choix d'option d'événement",
"verbose_name_plural": "choix d'option d'événement",
},
),
migrations.CreateModel(
name="Registration",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
],
options={
"verbose_name": "inscription à un événement",
"verbose_name_plural": "inscriptions à un événement",
},
),
migrations.RemoveField(model_name="event", name="subscribers"),
migrations.AddField(
model_name="event",
name="subscribers",
field=models.ManyToManyField(
through="events.Registration",
to=settings.AUTH_USER_MODEL,
verbose_name="inscrit⋅e⋅s",
),
),
migrations.AddField(
model_name="registration",
name="event",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="events.Event"
),
),
migrations.AddField(
model_name="registration",
name="options_choices",
field=models.ManyToManyField(to="events.OptionChoice"),
),
migrations.AddField(
model_name="registration",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
),
),
migrations.AddField(
model_name="option",
name="event",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="options",
to="events.Event",
),
),
migrations.CreateModel(
name="ExtraFieldContent",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("content", models.TextField(verbose_name="contenu du champ")),
(
"field",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="events.ExtraField",
),
),
(
"registration",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="extra_info",
to="events.Registration",
),
),
],
options={
"verbose_name": "contenu d'un champ événement supplémentaire",
"verbose_name_plural": "contenus d'un champ événement supplémentaire",
},
),
migrations.AddField(
model_name="extrafield",
name="event",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="extra_fields",
to="events.Event",
),
),
]