gestiojeux/inventory/migrations/0001_initial.py

54 lines
2.3 KiB
Python
Raw Normal View History

# Generated by Django 3.1.2 on 2020-10-11 15:42
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')),
],
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')),
],
),
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_images/', 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',
},
),
]