manuels-scolaires/manuels/migrations/0001_initial.py

143 lines
4.6 KiB
Python
Raw Normal View History

2018-05-22 00:55:14 +02:00
# Generated by Django 2.0.5 on 2018-05-21 22:47
2018-05-21 21:03:08 +02:00
2021-07-10 12:11:58 +02:00
import uuid
2018-05-21 23:23:43 +02:00
import django.db.models.deletion
2021-07-10 12:11:58 +02:00
from django.db import migrations, models
2018-05-21 23:23:43 +02:00
import manuels.models
2018-05-21 21:03:08 +02:00
class Migration(migrations.Migration):
initial = True
2021-07-10 12:11:58 +02:00
dependencies = []
2018-05-21 21:03:08 +02:00
operations = [
migrations.CreateModel(
2021-07-10 12:11:58 +02:00
name="Book",
2018-05-21 21:03:08 +02:00
fields=[
2021-07-10 12:11:58 +02:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("field", models.CharField(max_length=100, verbose_name="matière")),
("title", models.TextField(verbose_name="titre")),
("authors", models.TextField(verbose_name="auteurs")),
("editor", models.CharField(max_length=200, verbose_name="éditeur")),
(
"collection",
models.CharField(
blank=True, max_length=200, verbose_name="collection"
),
),
(
"publication_year",
models.PositiveIntegerField(verbose_name="année de publication"),
),
(
"isbn",
models.CharField(
max_length=20,
validators=[manuels.models.isbn_validator],
verbose_name="ISBN/EAN",
),
),
("price", models.PositiveIntegerField(verbose_name="prix")),
(
"previously_acquired",
models.BooleanField(
choices=[(True, "Oui"), (False, "Non")],
verbose_name="manuel acquis précédemment par l'élève",
),
),
2018-05-21 21:03:08 +02:00
],
2018-05-21 23:23:43 +02:00
options={
2021-07-10 12:11:58 +02:00
"verbose_name": "livre",
"verbose_name_plural": "livres",
2018-05-21 23:23:43 +02:00
},
),
migrations.CreateModel(
2021-07-10 12:11:58 +02:00
name="Level",
2018-05-21 23:23:43 +02:00
fields=[
2021-07-10 12:11:58 +02:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=10, verbose_name="nom")),
2018-05-21 23:23:43 +02:00
],
options={
2021-07-10 12:11:58 +02:00
"verbose_name": "classe",
"verbose_name_plural": "classes",
2018-05-21 23:23:43 +02:00
},
),
migrations.CreateModel(
2021-07-10 12:11:58 +02:00
name="Teacher",
2018-05-21 23:23:43 +02:00
fields=[
2021-07-10 12:11:58 +02:00
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("first_name", models.CharField(max_length=100, verbose_name="prénom")),
("last_name", models.CharField(max_length=100, verbose_name="nom")),
(
"phone_number",
models.CharField(
help_text="En cas d'urgence",
max_length=10,
verbose_name="numéro de téléphone",
),
),
(
"email",
models.EmailField(
help_text="Utilisée pour vous transmettre votre lien personnel",
max_length=254,
unique=True,
verbose_name="adresse email",
),
),
2018-05-21 23:23:43 +02:00
],
options={
2021-07-10 12:11:58 +02:00
"verbose_name": "enseignant",
"verbose_name_plural": "enseignants",
2018-05-21 23:23:43 +02:00
},
),
migrations.AddField(
2021-07-10 12:11:58 +02:00
model_name="book",
name="level",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="manuels.Level",
verbose_name="classe",
),
2018-05-21 23:23:43 +02:00
),
migrations.AddField(
2021-07-10 12:11:58 +02:00
model_name="book",
name="teacher",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="manuels.Teacher",
verbose_name="enseignant",
),
2018-05-21 21:03:08 +02:00
),
]