142 lines
4.6 KiB
Python
142 lines
4.6 KiB
Python
# Generated by Django 2.0.5 on 2018-05-21 22:47
|
|
|
|
import uuid
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
import manuels.models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Book",
|
|
fields=[
|
|
(
|
|
"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",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "livre",
|
|
"verbose_name_plural": "livres",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Level",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.AutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=10, verbose_name="nom")),
|
|
],
|
|
options={
|
|
"verbose_name": "classe",
|
|
"verbose_name_plural": "classes",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Teacher",
|
|
fields=[
|
|
(
|
|
"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",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "enseignant",
|
|
"verbose_name_plural": "enseignants",
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name="book",
|
|
name="level",
|
|
field=models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
to="manuels.Level",
|
|
verbose_name="classe",
|
|
),
|
|
),
|
|
migrations.AddField(
|
|
model_name="book",
|
|
name="teacher",
|
|
field=models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
to="manuels.Teacher",
|
|
verbose_name="enseignant",
|
|
),
|
|
),
|
|
]
|