openbackloggery/collection/games/migrations/0001_initial.py
Olivier DOSSMANN 242b0edff0 Refonte de la base:
* utilisation de classes abstraites Django : Item et Collection
  * héritage de ces classes pour Game et Console
  * création d'un objet Timeline contenant le changement d'état des jeux
  * affichage de la Timeline sur l'interface Admin
2017-08-22 21:02:43 +02:00

58 lines
2.4 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-08-22 18:56
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Console',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
],
options={
'ordering': ['name'],
'abstract': False,
},
),
migrations.CreateModel(
name='Game',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('playing', models.BooleanField(default=False)),
('unplayed', models.BooleanField(default=False)),
('wish', models.BooleanField(default=False)),
('status', models.CharField(choices=[('created', 'New'), ('beaten', 'Beaten'), ('completed', 'Completed'), ('excluded', 'Excluded'), ('mastered', 'Mastered'), ('unfinished', 'Unfinished')], default='unfinished', max_length=30)),
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='games', to='games.Console', verbose_name='console')),
],
options={
'ordering': ('-playing', 'name'),
},
),
migrations.CreateModel(
name='Timeline',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(default=datetime.datetime.now)),
('status', models.CharField(choices=[('created', 'New'), ('beaten', 'Beaten'), ('completed', 'Completed'), ('excluded', 'Excluded'), ('mastered', 'Mastered'), ('unfinished', 'Unfinished')], default='created', max_length=30)),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Game')),
],
options={
'ordering': ('-date',),
'abstract': False,
},
),
]