Create DB model and migration for past Pokemon types

This commit is contained in:
Julian Lawrance 2019-11-30 20:49:39 +00:00
parent eb5b0968eb
commit 1d9e41d100
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Generated by Django 2.1.2 on 2019-11-30 20:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pokemon_v2', '0003_auto_20160530_1132'),
]
operations = [
migrations.CreateModel(
name='PokemonTypePast',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slot', models.IntegerField()),
('generation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pokemontypepast', to='pokemon_v2.Generation')),
('pokemon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pokemontypepast', to='pokemon_v2.Pokemon')),
('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pokemontypepast', to='pokemon_v2.Type')),
],
options={
'abstract': False,
},
),
]

View file

@ -1480,6 +1480,12 @@ class PokemonType(HasPokemon, HasType):
slot = models.IntegerField()
# model for a Pokemon's types that were used until a given generation
class PokemonTypePast(HasPokemon, HasType, HasGeneration):
slot = models.IntegerField()
class PokemonSprites(HasPokemon):
sprites = models.CharField(max_length=500)