71 lines
2.2 KiB
Python
71 lines
2.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Partition",
|
|
fields=[
|
|
(
|
|
"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/")),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="PartitionSet",
|
|
fields=[
|
|
(
|
|
"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
|
|
),
|
|
),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name="partition",
|
|
name="morceau",
|
|
field=models.ForeignKey(
|
|
to="partitions.PartitionSet", on_delete=models.CASCADE
|
|
),
|
|
),
|
|
]
|