diff --git a/TODO b/TODO index d13812a..26d2f01 100644 --- a/TODO +++ b/TODO @@ -5,11 +5,10 @@ * Tests sur Game * Ajouter des attributs à Game * Données initiales des consoles connues - * Trier le champ console de Game par ordre alphabétique : Meta => order sur Console # Idée * Faire une apparence graphique pour afficher simplement les jeux en cours, les stats de jeux, et la liste totale des jeux ? (uikit, bulma ?) * Faire une API en vue d'un site web en VueJS ? * Inclure une récupération sur HowLongToBeat ? - * Gérer plusieurs utilisateurs ? Si oui, comment gérer la liste des jeux par utilisateur ? => à faire dans l'interface web peut-être ? \ No newline at end of file + * Gérer plusieurs utilisateurs ? Si oui, comment gérer la liste des jeux par utilisateur ? => à faire dans l'interface web peut-être ? diff --git a/collection/games/migrations/0001_initial.py b/collection/games/migrations/0001_initial.py index a536f0c..e5b6cb2 100644 --- a/collection/games/migrations/0001_initial.py +++ b/collection/games/migrations/0001_initial.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): @@ -19,5 +20,14 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=254)), ], + options={'ordering': ('name',)}, + ), + migrations.CreateModel( + name='Game', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=254)), + ('console', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Console')), + ], ), ] diff --git a/collection/games/migrations/0002_game.py b/collection/games/migrations/0002_game.py deleted file mode 100644 index a50a21a..0000000 --- a/collection/games/migrations/0002_game.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-08-16 20:05 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('games', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Game', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=254)), - ('console', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='games.Console')), - ], - ), - ] diff --git a/collection/games/models.py b/collection/games/models.py index 1f60b64..247f9a5 100644 --- a/collection/games/models.py +++ b/collection/games/models.py @@ -10,6 +10,9 @@ class Console(models.Model): def __str__(self): return '%s' % self.name + class Meta: + ordering = ('name',) + class Game(models.Model): """