chore: Update Django to 1.9

This commit is contained in:
Charles Marttinen 2018-10-18 16:23:48 -04:00 committed by Charles Marttinen
parent 6663813dc2
commit ee96433e6d
5 changed files with 439 additions and 401 deletions

View file

@ -44,7 +44,7 @@ TEST_RUNNER = 'django.test.runner.DiscoverRunner'
SECRET_KEY = '4nksdock439320df*(^x2_scm-o$*py3e@-awu-n^hipkm%2l$sw$&2l#'
MIDDLEWARE_CLASSES = (
MIDDLEWARE_CLASSES = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@ -52,7 +52,8 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
]
ROOT_URLCONF = 'config.urls'

View file

@ -16,7 +16,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('sprites', models.CharField(max_length=500)),
('item', models.ForeignKey(related_name='itemsprites', blank=True, to='pokemon_v2.Item', null=True)),
('item', models.ForeignKey(on_delete=models.CASCADE, related_name='itemsprites', blank=True, to='pokemon_v2.Item', null=True)),
],
options={
'abstract': False,
@ -27,7 +27,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('sprites', models.CharField(max_length=500)),
('pokemon_form', models.ForeignKey(related_name='pokemonformsprites', blank=True, to='pokemon_v2.PokemonForm', null=True)),
('pokemon_form', models.ForeignKey(on_delete=models.CASCADE, related_name='pokemonformsprites', blank=True, to='pokemon_v2.PokemonForm', null=True)),
],
options={
'abstract': False,
@ -38,7 +38,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('sprites', models.CharField(max_length=500)),
('pokemon', models.ForeignKey(related_name='pokemonsprites', blank=True, to='pokemon_v2.Pokemon', null=True)),
('pokemon', models.ForeignKey(on_delete=models.CASCADE, related_name='pokemonsprites', blank=True, to='pokemon_v2.Pokemon', null=True)),
],
options={
'abstract': False,

View file

@ -8,7 +8,8 @@ from django.db import models
class HasAbility(models.Model):
ability = models.ForeignKey('Ability', blank=True, null=True, related_name="%(class)s")
ability = models.ForeignKey('Ability', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -17,7 +18,7 @@ class HasAbility(models.Model):
class HasCharacteristic(models.Model):
characteristic = models.ForeignKey(
'Characteristic', blank=True, null=True, related_name="%(class)s")
'Characteristic', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -26,7 +27,7 @@ class HasCharacteristic(models.Model):
class HasContestType(models.Model):
contest_type = models.ForeignKey(
'ContestType', blank=True, null=True, related_name="%(class)s")
'ContestType', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -35,7 +36,7 @@ class HasContestType(models.Model):
class HasContestEffect(models.Model):
contest_effect = models.ForeignKey(
'ContestEffect', blank=True, null=True, related_name="%(class)s")
'ContestEffect', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -44,7 +45,7 @@ class HasContestEffect(models.Model):
class HasSuperContestEffect(models.Model):
super_contest_effect = models.ForeignKey(
'SuperContestEffect', blank=True, null=True, related_name="%(class)s")
'SuperContestEffect', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -61,7 +62,7 @@ class HasDescription(models.Model):
class HasGender(models.Model):
gender = models.ForeignKey(
'Gender', blank=True, null=True, related_name="%(class)s")
'Gender', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -78,7 +79,7 @@ class HasEffect(models.Model):
class HasEggGroup(models.Model):
egg_group = models.ForeignKey(
'EggGroup', blank=True, null=True, related_name="%(class)s")
'EggGroup', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -87,7 +88,7 @@ class HasEggGroup(models.Model):
class HasEncounterMethod(models.Model):
encounter_method = models.ForeignKey(
'EncounterMethod', blank=True, null=True, related_name="%(class)s")
'EncounterMethod', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -96,7 +97,7 @@ class HasEncounterMethod(models.Model):
class HasEncounterCondition(models.Model):
encounter_condition = models.ForeignKey(
'EncounterCondition', blank=True, null=True, related_name="%(class)s")
'EncounterCondition', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -105,7 +106,7 @@ class HasEncounterCondition(models.Model):
class HasEvolutionTrigger(models.Model):
evolution_trigger = models.ForeignKey(
'EvolutionTrigger', blank=True, null=True, related_name="%(class)s")
'EvolutionTrigger', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -122,7 +123,7 @@ class HasFlavorText(models.Model):
class HasFlingEffect(models.Model):
item_fling_effect = models.ForeignKey(
'ItemFlingEffect', blank=True, null=True, related_name="%(class)s")
'ItemFlingEffect', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -138,7 +139,8 @@ class HasGameIndex(models.Model):
class HasGeneration(models.Model):
generation = models.ForeignKey('Generation', blank=True, null=True, related_name="%(class)s")
generation = models.ForeignKey('Generation', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -146,7 +148,8 @@ class HasGeneration(models.Model):
class HasGrowthRate(models.Model):
growth_rate = models.ForeignKey('GrowthRate', blank=True, null=True, related_name="%(class)s")
growth_rate = models.ForeignKey('GrowthRate', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -154,7 +157,8 @@ class HasGrowthRate(models.Model):
class HasItem(models.Model):
item = models.ForeignKey('Item', blank=True, null=True, related_name="%(class)s")
item = models.ForeignKey('Item', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -163,7 +167,7 @@ class HasItem(models.Model):
class HasItemAttribute(models.Model):
item_attribute = models.ForeignKey(
'ItemAttribute', blank=True, null=True, related_name="%(class)s")
'ItemAttribute', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -172,7 +176,7 @@ class HasItemAttribute(models.Model):
class HasItemCategory(models.Model):
item_category = models.ForeignKey(
'ItemCategory', blank=True, null=True, related_name="%(class)s")
'ItemCategory', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -181,7 +185,7 @@ class HasItemCategory(models.Model):
class HasItemPocket(models.Model):
item_pocket = models.ForeignKey(
'ItemPocket', blank=True, null=True, related_name="%(class)s")
'ItemPocket', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -190,7 +194,7 @@ class HasItemPocket(models.Model):
class HasLanguage(models.Model):
language = models.ForeignKey(
'Language', blank=True, null=True, related_name="%(class)s_language")
'Language', blank=True, null=True, related_name="%(class)s_language", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -198,7 +202,8 @@ class HasLanguage(models.Model):
class HasLocation(models.Model):
location = models.ForeignKey('Location', blank=True, null=True, related_name="%(class)s")
location = models.ForeignKey('Location', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -207,7 +212,7 @@ class HasLocation(models.Model):
class HasLocationArea(models.Model):
location_area = models.ForeignKey(
'LocationArea', blank=True, null=True, related_name="%(class)s")
'LocationArea', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -216,7 +221,7 @@ class HasLocationArea(models.Model):
class HasMetaAilment(models.Model):
move_meta_ailment = models.ForeignKey(
'MoveMetaAilment', blank=True, null=True, related_name="%(class)s")
'MoveMetaAilment', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -225,7 +230,7 @@ class HasMetaAilment(models.Model):
class HasMetaCategory(models.Model):
move_meta_category = models.ForeignKey(
'MoveMetaCategory', blank=True, null=True, related_name="%(class)s")
'MoveMetaCategory', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -233,7 +238,8 @@ class HasMetaCategory(models.Model):
class HasMove(models.Model):
move = models.ForeignKey('Move', blank=True, null=True, related_name="%(class)s")
move = models.ForeignKey('Move', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -242,7 +248,7 @@ class HasMove(models.Model):
class HasMoveDamageClass(models.Model):
move_damage_class = models.ForeignKey(
'MoveDamageClass', blank=True, null=True, related_name="%(class)s")
'MoveDamageClass', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -250,7 +256,7 @@ class HasMoveDamageClass(models.Model):
class HasMoveEffect(models.Model):
move_effect = models.ForeignKey('MoveEffect', blank=True, null=True)
move_effect = models.ForeignKey('MoveEffect', blank=True, null=True, on_delete=models.CASCADE)
class Meta:
abstract = True
@ -258,7 +264,8 @@ class HasMoveEffect(models.Model):
class HasMoveAttribute(models.Model):
move_attribute = models.ForeignKey('MoveAttribute', blank=True, null=True)
move_attribute = models.ForeignKey(
'MoveAttribute', blank=True, null=True, on_delete=models.CASCADE)
class Meta:
abstract = True
@ -267,7 +274,7 @@ class HasMoveAttribute(models.Model):
class HasMoveTarget(models.Model):
move_target = models.ForeignKey(
'MoveTarget', blank=True, null=True, related_name="%(class)s")
'MoveTarget', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -283,7 +290,8 @@ class HasName(models.Model):
class HasNature(models.Model):
nature = models.ForeignKey('Nature', blank=True, null=True, related_name="%(class)s")
nature = models.ForeignKey('Nature', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -300,7 +308,7 @@ class HasOrder(models.Model):
class HasPokeathlonStat(models.Model):
pokeathlon_stat = models.ForeignKey(
'PokeathlonStat', blank=True, null=True, related_name="%(class)s")
'PokeathlonStat', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -308,7 +316,8 @@ class HasPokeathlonStat(models.Model):
class HasPokedex(models.Model):
pokedex = models.ForeignKey('Pokedex', blank=True, null=True, related_name="%(class)s")
pokedex = models.ForeignKey('Pokedex', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -316,7 +325,8 @@ class HasPokedex(models.Model):
class HasPokemon(models.Model):
pokemon = models.ForeignKey('Pokemon', blank=True, null=True, related_name="%(class)s")
pokemon = models.ForeignKey('Pokemon', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -325,7 +335,7 @@ class HasPokemon(models.Model):
class HasPokemonColor(models.Model):
pokemon_color = models.ForeignKey(
'PokemonColor', blank=True, null=True, related_name="%(class)s")
'PokemonColor', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -334,7 +344,7 @@ class HasPokemonColor(models.Model):
class HasPokemonForm(models.Model):
pokemon_form = models.ForeignKey(
'PokemonForm', blank=True, null=True, related_name="%(class)s")
'PokemonForm', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -343,7 +353,7 @@ class HasPokemonForm(models.Model):
class HasPokemonHabitat(models.Model):
pokemon_habitat = models.ForeignKey(
'PokemonHabitat', blank=True, null=True, related_name="%(class)s")
'PokemonHabitat', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -353,7 +363,7 @@ class HasPokemonHabitat(models.Model):
class HasMoveLearnMethod(models.Model):
move_learn_method = models.ForeignKey(
'MoveLearnMethod', blank=True, null=True, related_name="%(class)s")
'MoveLearnMethod', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -362,7 +372,7 @@ class HasMoveLearnMethod(models.Model):
class HasPokemonShape(models.Model):
pokemon_shape = models.ForeignKey(
'PokemonShape', blank=True, null=True, related_name="%(class)s")
'PokemonShape', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -371,7 +381,7 @@ class HasPokemonShape(models.Model):
class HasPokemonSpecies(models.Model):
pokemon_species = models.ForeignKey(
'PokemonSpecies', blank=True, null=True, related_name="%(class)s")
'PokemonSpecies', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -379,7 +389,8 @@ class HasPokemonSpecies(models.Model):
class HasRegion(models.Model):
region = models.ForeignKey('Region', blank=True, null=True, related_name="%(class)s")
region = models.ForeignKey('Region', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -395,7 +406,8 @@ class HasShortEffect(models.Model):
class HasStat(models.Model):
stat = models.ForeignKey('Stat', blank=True, null=True, related_name="%(class)s")
stat = models.ForeignKey('Stat', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -403,7 +415,8 @@ class HasStat(models.Model):
class HasType(models.Model):
type = models.ForeignKey('Type', blank=True, null=True, related_name="%(class)s")
type = models.ForeignKey('Type', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -411,7 +424,8 @@ class HasType(models.Model):
class HasVersion(models.Model):
version = models.ForeignKey('Version', blank=True, null=True, related_name="%(class)s")
version = models.ForeignKey('Version', blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -420,7 +434,7 @@ class HasVersion(models.Model):
class HasVersionGroup(models.Model):
version_group = models.ForeignKey(
'VersionGroup', blank=True, null=True, related_name="%(class)s")
'VersionGroup', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Meta:
abstract = True
@ -485,7 +499,7 @@ class Language(HasName, HasOrder):
class LanguageName(IsName):
local_language = models.ForeignKey(
'Language', blank=True, null=True, related_name="locallanguage")
'Language', blank=True, null=True, related_name="locallanguage", on_delete=models.CASCADE)
#######################
@ -494,7 +508,7 @@ class LanguageName(IsName):
class Generation(HasName):
region = models.OneToOneField('Region', blank=True, null=True, related_name="%(class)s")
region = models.OneToOneField('Region', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class GenerationName(IsName, HasGeneration):
@ -541,7 +555,7 @@ class AbilityChange(HasAbility, HasVersionGroup):
class AbilityChangeEffectText(HasLanguage, HasEffect):
ability_change = models.ForeignKey(
AbilityChange, blank=True, null=True, related_name="%(class)s")
AbilityChange, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
#################
@ -562,9 +576,11 @@ class TypeGameIndex(HasType, HasGeneration, HasGameIndex):
class TypeEfficacy(models.Model):
damage_type = models.ForeignKey('Type', blank=True, null=True, related_name="damage_type")
damage_type = models.ForeignKey('Type', blank=True, null=True,
related_name="damage_type", on_delete=models.CASCADE)
target_type = models.ForeignKey('Type', blank=True, null=True, related_name="target_type")
target_type = models.ForeignKey('Type', blank=True, null=True,
related_name="target_type", on_delete=models.CASCADE)
damage_factor = models.IntegerField()
@ -713,9 +729,11 @@ class ContestEffectFlavorText(HasLanguage, HasFlavorText, HasContestEffect):
class ContestCombo(models.Model):
first_move = models.ForeignKey('Move', blank=True, null=True, related_name='first_move')
first_move = models.ForeignKey('Move', blank=True, null=True,
related_name='first_move', on_delete=models.CASCADE)
second_move = models.ForeignKey('Move', blank=True, null=True, related_name='second_move')
second_move = models.ForeignKey('Move', blank=True, null=True,
related_name='second_move', on_delete=models.CASCADE)
##################
@ -729,17 +747,18 @@ class BerryFirmness(HasName):
class BerryFirmnessName(IsName):
berry_firmness = models.ForeignKey(
BerryFirmness, blank=True, null=True, related_name="%(class)s")
BerryFirmness, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class Berry(HasName, HasItem):
berry_firmness = models.ForeignKey(
BerryFirmness, blank=True, null=True, related_name="%(class)s")
BerryFirmness, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
natural_gift_power = models.IntegerField()
natural_gift_type = models.ForeignKey(Type, blank=True, null=True, related_name="%(class)s")
natural_gift_type = models.ForeignKey(
Type, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
size = models.IntegerField()
@ -764,19 +783,22 @@ is a table fabricated just to suit this project.
class BerryFlavor(HasName):
contest_type = models.OneToOneField(
'ContestType', blank=True, null=True, related_name="%(class)s")
'ContestType', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class BerryFlavorName(IsName):
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True, related_name="%(class)s")
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
class BerryFlavorMap(models.Model):
berry = models.ForeignKey(Berry, blank=True, null=True, related_name="%(class)s")
berry = models.ForeignKey(Berry, blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True, related_name="%(class)s")
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True,
related_name="%(class)s", on_delete=models.CASCADE)
potency = models.IntegerField()
@ -800,15 +822,17 @@ class GrowthRateDescription(HasGrowthRate, IsDescription):
class Nature(HasName):
decreased_stat = models.ForeignKey(Stat, blank=True, null=True, related_name='decreased')
decreased_stat = models.ForeignKey(
Stat, blank=True, null=True, related_name='decreased', on_delete=models.CASCADE)
increased_stat = models.ForeignKey(Stat, blank=True, null=True, related_name='increased')
increased_stat = models.ForeignKey(
Stat, blank=True, null=True, related_name='increased', on_delete=models.CASCADE)
hates_flavor = models.ForeignKey(
BerryFlavor, blank=True, null=True, related_name='hates_flavor')
BerryFlavor, blank=True, null=True, related_name='hates_flavor', on_delete=models.CASCADE)
likes_flavor = models.ForeignKey(
BerryFlavor, blank=True, null=True, related_name='likes_flavor')
BerryFlavor, blank=True, null=True, related_name='likes_flavor', on_delete=models.CASCADE)
game_index = models.IntegerField()
@ -825,7 +849,7 @@ class NaturePokeathlonStat(HasNature, HasPokeathlonStat):
class NatureBattleStylePreference(HasNature):
move_battle_style = models.ForeignKey(
'MoveBattleStyle', blank=True, null=True, related_name="%(class)s")
'MoveBattleStyle', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
low_hp_preference = models.IntegerField()
@ -882,7 +906,8 @@ class EncounterSlot(HasVersionGroup, HasEncounterMethod):
class Encounter(HasVersion, HasLocationArea, HasPokemon):
encounter_slot = models.ForeignKey(EncounterSlot, blank=True, null=True)
encounter_slot = models.ForeignKey(EncounterSlot, blank=True,
null=True, on_delete=models.CASCADE)
min_level = models.IntegerField()
@ -905,14 +930,15 @@ class EncounterConditionValue(HasEncounterCondition, HasName):
class EncounterConditionValueName(IsName):
encounter_condition_value = models.ForeignKey(
EncounterConditionValue, blank=True, null=True, related_name="%(class)s")
EncounterConditionValue, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class EncounterConditionValueMap(models.Model):
encounter = models.ForeignKey(Encounter, blank=True, null=True)
encounter = models.ForeignKey(Encounter, blank=True, null=True, on_delete=models.CASCADE)
encounter_condition_value = models.ForeignKey(EncounterConditionValue, blank=True, null=True)
encounter_condition_value = models.ForeignKey(
EncounterConditionValue, blank=True, null=True, on_delete=models.CASCADE)
#################
@ -980,7 +1006,7 @@ class MoveBattleStyle(HasName):
class MoveBattleStyleName(IsName):
move_battle_style = models.ForeignKey(
MoveBattleStyle, blank=True, null=True, related_name="%(class)s")
MoveBattleStyle, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
########################
@ -1002,7 +1028,7 @@ class MoveEffectChange(HasMoveEffect, HasVersionGroup):
class MoveEffectChangeEffectText(HasLanguage, HasEffect):
move_effect_change = models.ForeignKey(
'MoveEffectChange', blank=True, null=True, related_name="%(class)s")
'MoveEffectChange', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
################################
@ -1047,7 +1073,7 @@ class MoveTargetDescription(HasMoveTarget, IsDescription):
class MoveMeta(HasMetaAilment, HasMetaCategory):
move = models.OneToOneField(Move, blank=False, null=False, related_name="%(class)s")
move = models.OneToOneField(Move, blank=False, null=False, related_name="%(class)s", on_delete=models.CASCADE)
min_hits = models.IntegerField(blank=True, null=True)
@ -1118,9 +1144,9 @@ class Machine(HasGrowthRate, HasItem):
machine_number = models.IntegerField()
version_group = models.ForeignKey(VersionGroup, blank=True, null=True)
version_group = models.ForeignKey(VersionGroup, blank=True, null=True, on_delete=models.CASCADE)
move = models.ForeignKey(Move, blank=True, null=True)
move = models.ForeignKey(Move, blank=True, null=True, on_delete=models.CASCADE)
#######################
@ -1146,13 +1172,13 @@ class PalParkArea(HasName):
class PalParkAreaName(IsName):
pal_park_area = models.ForeignKey(
PalParkArea, blank=True, null=True, related_name="%(class)s")
PalParkArea, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class PalPark(HasPokemonSpecies):
pal_park_area = models.ForeignKey(
PalParkArea, blank=True, null=True, related_name="%(class)s")
PalParkArea, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
base_score = models.IntegerField(blank=True, null=True)
@ -1174,9 +1200,11 @@ class SuperContestEffectFlavorText(IsFlavorText, HasSuperContestEffect):
class SuperContestCombo(models.Model):
first_move = models.ForeignKey(Move, blank=True, null=True, related_name='first')
first_move = models.ForeignKey(Move, blank=True, null=True,
related_name='first', on_delete=models.CASCADE)
second_move = models.ForeignKey(Move, blank=True, null=True, related_name='second')
second_move = models.ForeignKey(Move, blank=True, null=True,
related_name='second', on_delete=models.CASCADE)
######################
@ -1185,7 +1213,7 @@ class SuperContestCombo(models.Model):
class EvolutionChain(models.Model):
baby_trigger_item = models.ForeignKey(Item, blank=True, null=True)
baby_trigger_item = models.ForeignKey(Item, blank=True, null=True, on_delete=models.CASCADE)
class EvolutionTrigger(HasName):
@ -1224,12 +1252,14 @@ class PokedexVersionGroup(HasPokedex, HasVersionGroup):
class PokemonSpecies(HasName, HasGeneration, HasPokemonColor,
HasPokemonShape, HasGrowthRate, HasOrder):
evolves_from_species = models.ForeignKey('self', blank=True, null=True)
evolves_from_species = models.ForeignKey(
'self', blank=True, null=True, on_delete=models.CASCADE)
evolution_chain = models.ForeignKey(EvolutionChain, blank=True, null=True)
evolution_chain = models.ForeignKey(
EvolutionChain, blank=True, null=True, on_delete=models.CASCADE)
pokemon_habitat = models.ForeignKey(
'PokemonHabitat', blank=True, null=True, related_name="%(class)s")
'PokemonHabitat', blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
gender_rate = models.IntegerField()
@ -1296,22 +1326,26 @@ class PokemonEggGroup(HasPokemonSpecies, HasEggGroup):
class PokemonEvolution(HasEvolutionTrigger, HasGender):
evolution_item = models.ForeignKey(Item, blank=True, null=True, related_name='evolution_item')
evolution_item = models.ForeignKey(
Item, blank=True, null=True, related_name='evolution_item', on_delete=models.CASCADE)
evolved_species = models.ForeignKey(
PokemonSpecies, related_name="evolved_species", blank=True, null=True)
PokemonSpecies, related_name="evolved_species", blank=True, null=True, on_delete=models.CASCADE)
min_level = models.IntegerField(blank=True, null=True)
location = models.ForeignKey(Location, related_name="location", blank=True, null=True)
location = models.ForeignKey(Location, related_name="location",
blank=True, null=True, on_delete=models.CASCADE)
held_item = models.ForeignKey(Item, blank=True, null=True, related_name='held_item')
held_item = models.ForeignKey(Item, blank=True, null=True,
related_name='held_item', on_delete=models.CASCADE)
time_of_day = models.CharField(max_length=10, blank=True, null=True)
known_move = models.ForeignKey(Move, blank=True, null=True)
known_move = models.ForeignKey(Move, blank=True, null=True, on_delete=models.CASCADE)
known_move_type = models.ForeignKey(Type, related_name="known_move", blank=True, null=True)
known_move_type = models.ForeignKey(
Type, related_name="known_move", blank=True, null=True, on_delete=models.CASCADE)
min_happiness = models.IntegerField(blank=True, null=True)
@ -1322,12 +1356,13 @@ class PokemonEvolution(HasEvolutionTrigger, HasGender):
relative_physical_stats = models.IntegerField(blank=True, null=True)
party_species = models.ForeignKey(
PokemonSpecies, related_name="party_species", blank=True, null=True)
PokemonSpecies, related_name="party_species", blank=True, null=True, on_delete=models.CASCADE)
party_type = models.ForeignKey(Type, related_name="party_type", blank=True, null=True)
party_type = models.ForeignKey(Type, related_name="party_type",
blank=True, null=True, on_delete=models.CASCADE)
trade_species = models.ForeignKey(
PokemonSpecies, related_name="trade_species", blank=True, null=True)
PokemonSpecies, related_name="trade_species", blank=True, null=True, on_delete=models.CASCADE)
needs_overworld_rain = models.BooleanField(default=False)
@ -1338,7 +1373,7 @@ class PokemonForm(HasName, HasPokemon, HasOrder):
form_name = models.CharField(max_length=30)
version_group = models.ForeignKey(VersionGroup, blank=True, null=True)
version_group = models.ForeignKey(VersionGroup, blank=True, null=True, on_delete=models.CASCADE)
is_default = models.BooleanField(default=False)
@ -1374,7 +1409,7 @@ class PokemonHabitat(HasName):
class PokemonHabitatName(IsName):
pokemon_habitat = models.ForeignKey(
PokemonHabitat, blank=True, null=True, related_name="%(class)s")
PokemonHabitat, blank=True, null=True, related_name="%(class)s", on_delete=models.CASCADE)
class PokemonItem(HasPokemon, HasVersion, HasItem):
@ -1410,7 +1445,9 @@ class PokemonShapeName(IsName):
awesome_name = models.CharField(max_length=30)
pokemon_shape = models.ForeignKey(
PokemonShape, blank=True, null=True, related_name="pokemonshapename")
PokemonShape, blank=True, null=True,
related_name="pokemonshapename", on_delete=models.CASCADE
)
class PokemonStat(HasPokemon, HasStat):

View file

@ -1,9 +1,9 @@
Django==1.8.14
Django==1.9
Pillow==2.6.1
Unipath==1.1
coverage==3.6
django-appconf==0.6
django-cors-headers==1.0.0
django-cors-headers==2.4.0
django-discover-runner==0.4
django-imagekit==4.0.1
django-redis==4.8.0