gestiojeux/inventory/migrations/0001_initial.py
2020-12-30 00:31:58 +01:00

87 lines
4.5 KiB
Python

# Generated by Django 3.1.2 on 2020-12-29 23:21
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import website.validators
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256, unique=True, verbose_name='nom')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
],
options={
'verbose_name': 'catégorie',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Game',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=256, unique=True, verbose_name='titre du jeu')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='title', unique=True)),
('nb_player_min', models.PositiveSmallIntegerField(verbose_name='nombre de joueur·se·s minimum')),
('nb_player_max', models.PositiveSmallIntegerField(verbose_name='nombre de joueur·se·s maximum')),
('player_range', models.CharField(blank=True, help_text='Affichage personnalisé pour le nombre de joueur·se·s', max_length=256, verbose_name='nombre de joueur·se·s')),
('duration', models.CharField(blank=True, max_length=256, verbose_name='durée de partie')),
('game_designer', models.CharField(blank=True, max_length=256, verbose_name='game designer')),
('illustrator', models.CharField(blank=True, max_length=256, verbose_name='illustrateur·trice')),
('editor', models.CharField(blank=True, max_length=256, verbose_name='éditeur')),
('description', models.TextField(blank=True, verbose_name='description')),
('image', models.ImageField(blank=True, help_text="L'image doit peser 512 Kio au maximum", upload_to='game_img/', validators=[website.validators.MaxFileSizeValidator(512)], verbose_name='image')),
('missing_elements', models.TextField(blank=True, verbose_name='pièces manquantes')),
('category', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='inventory.category', verbose_name='catégorie')),
],
options={
'verbose_name': 'jeu',
'verbose_name_plural': 'jeux',
'ordering': ['title'],
},
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256, unique=True, verbose_name='nom')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
],
options={
'ordering': ['name'],
},
),
migrations.CreateModel(
name='GameComment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField(verbose_name='texte')),
('created_on', models.DateTimeField(auto_now_add=True, verbose_name='date de publication')),
('modified_on', models.DateTimeField(auto_now=True, verbose_name='date de modification')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='auteur·ice')),
('commented_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='inventory.game', verbose_name='jeu')),
],
options={
'verbose_name': 'commentaire sur un jeu',
'verbose_name_plural': 'commentaires sur des jeux',
'ordering': ['created_on'],
},
),
migrations.AddField(
model_name='game',
name='tags',
field=models.ManyToManyField(blank=True, to='inventory.Tag', verbose_name='tags'),
),
]