gestiojeux/inventory/migrations/0001_initial.py
2020-11-22 19:01:21 +01:00

55 lines
2.5 KiB
Python

# Generated by Django 3.1.2 on 2020-11-21 18:17
import autoslug.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
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, verbose_name='nom')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
],
options={
'verbose_name': 'catégorie',
},
),
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, verbose_name='nom')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
],
),
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, verbose_name='titre')),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='title', unique=True)),
('player_range', models.CharField(max_length=256, verbose_name='nombre de joueur·se·s')),
('duration', models.CharField(max_length=256, verbose_name='durée de partie')),
('editor', models.CharField(blank=True, max_length=256, verbose_name='éditeur')),
('game_designer', models.CharField(blank=True, max_length=256, verbose_name='game designer')),
('description', models.TextField(blank=True, verbose_name='description')),
('image', models.ImageField(blank=True, upload_to='game_img/', verbose_name='image')),
('category', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='inventory.category', verbose_name='catégorie')),
('tags', models.ManyToManyField(blank=True, to='inventory.Tag', verbose_name='tags')),
],
options={
'verbose_name': 'jeu',
'verbose_name_plural': 'jeux',
},
),
]