Console : tri par nom
This commit is contained in:
parent
9560cdd574
commit
235cb0e453
1
TODO
1
TODO
@ -5,7 +5,6 @@
|
||||
* 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
|
||||
|
||||
|
@ -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')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
@ -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')),
|
||||
],
|
||||
),
|
||||
]
|
@ -10,6 +10,9 @@ class Console(models.Model):
|
||||
def __str__(self):
|
||||
return '%s' % self.name
|
||||
|
||||
class Meta:
|
||||
ordering = ('name',)
|
||||
|
||||
|
||||
class Game(models.Model):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user