ernestophone.ens.fr/partitions/migrations/0001_initial.py

72 lines
2.2 KiB
Python
Raw Normal View History

2015-03-17 19:03:51 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2017-05-23 10:30:18 +02:00
from django.db import migrations, models
2015-03-17 19:03:51 +01:00
class Migration(migrations.Migration):
2021-04-29 00:27:33 +02:00
dependencies = []
2015-03-17 19:03:51 +01:00
operations = [
migrations.CreateModel(
2021-04-29 00:27:33 +02:00
name="Partition",
2015-03-17 19:03:51 +01:00
fields=[
2021-04-29 00:27:33 +02:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
verbose_name="ID",
serialize=False,
),
),
("nom", models.CharField(max_length=100)),
("part", models.FileField(upload_to="partitions/")),
2015-03-17 19:03:51 +01:00
],
2017-05-23 10:30:18 +02:00
),
migrations.CreateModel(
2021-04-29 00:27:33 +02:00
name="PartitionSet",
2017-05-23 10:30:18 +02:00
fields=[
2021-04-29 00:27:33 +02:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
verbose_name="ID",
serialize=False,
),
),
("nom", models.CharField(max_length=100)),
("auteur", models.CharField(max_length=100)),
(
"category",
models.CharField(
max_length=8,
choices=[
("active", "Actif"),
("incoming", "À venir"),
("old", "Archive"),
("optional", "Optionnel"),
],
default="incoming",
verbose_name="Types de partitions",
),
),
(
"infos",
models.TextField(
blank=True, verbose_name="Infos utiles", null=True
),
),
2017-05-23 10:30:18 +02:00
],
),
migrations.AddField(
2021-04-29 00:27:33 +02:00
model_name="partition",
name="morceau",
field=models.ForeignKey(
to="partitions.PartitionSet", on_delete=models.CASCADE
),
2015-03-17 19:03:51 +01:00
),
]