mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-10 14:14:17 +00:00
Finished tests for all current API endpoints (34 of them)
This commit is contained in:
parent
f3654c3458
commit
44151e1963
12 changed files with 2231 additions and 956 deletions
397
data/v2/build.py
397
data/v2/build.py
|
@ -73,7 +73,7 @@ def clearTable(model):
|
|||
|
||||
# languageName = LanguageName (
|
||||
# language = Language.objects.get(pk = int(info[0])),
|
||||
# local_language_id = int(info[1]),
|
||||
# local_language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
|
||||
|
@ -224,18 +224,26 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveDamageClassName)
|
||||
# clearTable(MoveDamageClassDescription)
|
||||
# data = loadData('move_damage_class_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveDamageClassDescription (
|
||||
# model_name = MoveDamageClassName (
|
||||
# move_damage_class = MoveDamageClass.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# description = info[2]
|
||||
# name = info[2]
|
||||
# )
|
||||
# model.save()
|
||||
# model_name.save()
|
||||
|
||||
# model_description = MoveDamageClassDescription (
|
||||
# move_damage_class = MoveDamageClass.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# description = info[3]
|
||||
# )
|
||||
# model_description.save()
|
||||
|
||||
|
||||
# ###########
|
||||
|
@ -334,13 +342,13 @@ def clearTable(model):
|
|||
# abilityName.save()
|
||||
|
||||
|
||||
# clearTable(AbilityDescription)
|
||||
# clearTable(AbilityEffectText)
|
||||
# data = loadData('ability_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# abilityDesc = AbilityDescription (
|
||||
# abilityDesc = AbilityEffectText (
|
||||
# ability = Ability.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# short_effect = info[2],
|
||||
|
@ -576,13 +584,13 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(ItemDescription)
|
||||
# clearTable(ItemEffectText)
|
||||
# data = loadData('item_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = ItemDescription (
|
||||
# model = ItemEffectText (
|
||||
# item = Item.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# short_effect = info[2],
|
||||
|
@ -633,19 +641,26 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(ItemAttributeName)
|
||||
# clearTable(ItemAttributeDescription)
|
||||
# data = loadData('item_flag_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = ItemAttributeDescription (
|
||||
# model_name = ItemAttributeName (
|
||||
# item_attribute = ItemAttribute.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# model_name.save()
|
||||
|
||||
# model_description = ItemAttributeDescription (
|
||||
# item_attribute = ItemAttribute.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2],
|
||||
# description = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
# model_description.save()
|
||||
|
||||
|
||||
# clearTable(ItemAttributeMap)
|
||||
|
@ -740,13 +755,13 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveEffectDescription)
|
||||
# clearTable(MoveEffectEffectText)
|
||||
# data = loadData('move_effect_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveEffectDescription (
|
||||
# model = MoveEffectEffectText (
|
||||
# move_effect = MoveEffect.objects.get(pk = int(info[1])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# short_effect = info[2],
|
||||
|
@ -769,13 +784,13 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveEffectChangeDescription)
|
||||
# clearTable(MoveEffectChangeEffectText)
|
||||
# data = loadData('move_effect_changelog_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveEffectChangeDescription (
|
||||
# model = MoveEffectChangeEffectText (
|
||||
# move_effect_change = MoveEffectChange.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# effect = info[2]
|
||||
|
@ -796,18 +811,25 @@ def clearTable(model):
|
|||
|
||||
|
||||
# clearTable(MoveLearnMethodName)
|
||||
# clearTable(MoveLearnMethodDescription)
|
||||
# data = loadData('pokemon_move_method_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveLearnMethodName (
|
||||
# model_name = MoveLearnMethodName (
|
||||
# move_learn_method = MoveLearnMethod.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# model_name.save()
|
||||
|
||||
# model_description = MoveLearnMethodDescription (
|
||||
# move_learn_method = MoveLearnMethod.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2],
|
||||
# description = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
# model_description.save()
|
||||
|
||||
|
||||
# clearTable(MoveTarget)
|
||||
|
@ -823,19 +845,26 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveTargetName)
|
||||
# clearTable(MoveTargetDescription)
|
||||
# data = loadData('move_target_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveTargetDescription (
|
||||
# model_name = MoveTargetName (
|
||||
# move_target = MoveTarget.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# model_name.save()
|
||||
|
||||
# model_description = MoveTargetDescription (
|
||||
# move_target = MoveTarget.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2],
|
||||
# description = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
# model_description.save()
|
||||
|
||||
|
||||
# clearTable(Move)
|
||||
|
@ -954,45 +983,52 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveFlag)
|
||||
# clearTable(MoveAttribute)
|
||||
# data = loadData('move_flags.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveFlag (
|
||||
# model = MoveAttribute (
|
||||
# id = int(info[0]),
|
||||
# name = info[1]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveFlagMap)
|
||||
# clearTable(MoveAttributeMap)
|
||||
# data = loadData('move_flag_map.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveFlagMap (
|
||||
# model = MoveAttributeMap (
|
||||
# move = Move.objects.get(pk = int(info[0])),
|
||||
# move_flag = MoveFlag.objects.get(pk = int(info[1])),
|
||||
# move_attribute = MoveAttribute.objects.get(pk = int(info[1])),
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
# clearTable(MoveFlagDescription)
|
||||
# clearTable(MoveAttributeName)
|
||||
# clearTable(MoveAttributeDescription)
|
||||
# data = loadData('move_flag_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = MoveFlagDescription (
|
||||
# move_flag = MoveFlag.objects.get(pk = int(info[0])),
|
||||
# name_model = MoveAttributeName (
|
||||
# move_attribute = MoveAttribute.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# name_model.save()
|
||||
|
||||
# description_model = MoveAttributeDescription (
|
||||
# move_attribute = MoveAttribute.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2],
|
||||
# description = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
# description_model.save()
|
||||
|
||||
|
||||
# clearTable(MoveMetaAilment)
|
||||
|
@ -1135,20 +1171,26 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(ContestEffectDescription)
|
||||
# clearTable(ContestEffectEffectText)
|
||||
# data = loadData('contest_effect_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = ContestEffectDescription (
|
||||
# model = ContestEffectEffectText (
|
||||
# contest_effect = ContestEffect.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# flavor_text = info[2],
|
||||
# effect = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
# model = ContestEffectFlavorText (
|
||||
# contest_effect = ContestEffect.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# flavor_text = info[2]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
# clearTable(ContestCombo)
|
||||
# data = loadData('contest_combos.csv')
|
||||
|
@ -1176,13 +1218,13 @@ def clearTable(model):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(SuperContestEffectDescription)
|
||||
# clearTable(SuperContestEffectFlavorText)
|
||||
# data = loadData('super_contest_effect_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = SuperContestEffectDescription (
|
||||
# model = SuperContestEffectFlavorText (
|
||||
# super_contest_effect = SuperContestEffect.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# flavor_text = info[2]
|
||||
|
@ -1204,156 +1246,156 @@ def clearTable(model):
|
|||
|
||||
|
||||
|
||||
#############
|
||||
# BERRIES #
|
||||
#############
|
||||
# #############
|
||||
# # BERRIES #
|
||||
# #############
|
||||
|
||||
clearTable(BerryFirmness)
|
||||
data = loadData('berry_firmness.csv')
|
||||
# clearTable(BerryFirmness)
|
||||
# data = loadData('berry_firmness.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
model = BerryFirmness (
|
||||
id = int(info[0]),
|
||||
name = info[1]
|
||||
)
|
||||
model.save()
|
||||
# model = BerryFirmness (
|
||||
# id = int(info[0]),
|
||||
# name = info[1]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
clearTable(BerryFirmnessName)
|
||||
data = loadData('berry_firmness_names.csv')
|
||||
# clearTable(BerryFirmnessName)
|
||||
# data = loadData('berry_firmness_names.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
model = BerryFirmnessName (
|
||||
berry_firmness = BerryFirmness.objects.get(pk = int(info[0])),
|
||||
language = Language.objects.get(pk = int(info[1])),
|
||||
name = info[2]
|
||||
)
|
||||
model.save()
|
||||
# model = BerryFirmnessName (
|
||||
# berry_firmness = BerryFirmness.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
clearTable(Berry)
|
||||
data = loadData('berries.csv')
|
||||
# clearTable(Berry)
|
||||
# data = loadData('berries.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
name = getattr(Item.objects.get(pk = int(info[1])), 'name')
|
||||
# name = getattr(Item.objects.get(pk = int(info[1])), 'name')
|
||||
|
||||
model = Berry (
|
||||
id = int(info[0]),
|
||||
item = Item.objects.get(pk = int(info[1])),
|
||||
name = name[:name.index('-')],
|
||||
berry_firmness = BerryFirmness.objects.get(pk = int(info[2])),
|
||||
natural_gift_power = int(info[3]),
|
||||
nature = None,
|
||||
size = int(info[5]),
|
||||
max_harvest = int(info[6]),
|
||||
growth_time = int(info[7]),
|
||||
soil_dryness = int(info[8]),
|
||||
smoothness = int(info[9])
|
||||
)
|
||||
model.save()
|
||||
# model = Berry (
|
||||
# id = int(info[0]),
|
||||
# item = Item.objects.get(pk = int(info[1])),
|
||||
# name = name[:name.index('-')],
|
||||
# berry_firmness = BerryFirmness.objects.get(pk = int(info[2])),
|
||||
# natural_gift_power = int(info[3]),
|
||||
# nature = None,
|
||||
# size = int(info[5]),
|
||||
# max_harvest = int(info[6]),
|
||||
# growth_time = int(info[7]),
|
||||
# soil_dryness = int(info[8]),
|
||||
# smoothness = int(info[9])
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
clearTable(BerryFlavor)
|
||||
data = loadData('berry_flavors.csv')
|
||||
# clearTable(BerryFlavor)
|
||||
# data = loadData('berry_flavors.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
model = BerryFlavor (
|
||||
berry = Berry.objects.get(pk = int(info[0])),
|
||||
contest_type = ContestType.objects.get(pk = int(info[1])),
|
||||
flavor = int(info[2])
|
||||
)
|
||||
model.save()
|
||||
# model = BerryFlavor (
|
||||
# berry = Berry.objects.get(pk = int(info[0])),
|
||||
# contest_type = ContestType.objects.get(pk = int(info[1])),
|
||||
# flavor = int(info[2])
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
|
||||
############
|
||||
# NATURE #
|
||||
############
|
||||
# ############
|
||||
# # NATURE #
|
||||
# ############
|
||||
|
||||
clearTable(Nature)
|
||||
data = loadData('natures.csv')
|
||||
# clearTable(Nature)
|
||||
# data = loadData('natures.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
nature = Nature (
|
||||
id = int(info[0]),
|
||||
name = info[1],
|
||||
decreased_stat_id = Stat.objects.get(pk = int(info[2])),
|
||||
increased_stat_id = Stat.objects.get(pk = int(info[3])),
|
||||
hates_flavor_id = BerryFlavor.objects.get(pk = int(info[4])),
|
||||
likes_flavor_id = BerryFlavor.objects.get(pk = int(info[5])),
|
||||
game_index = info[6]
|
||||
)
|
||||
nature.save()
|
||||
# nature = Nature (
|
||||
# id = int(info[0]),
|
||||
# name = info[1],
|
||||
# decreased_stat = Stat.objects.get(pk = int(info[2])),
|
||||
# increased_stat = Stat.objects.get(pk = int(info[3])),
|
||||
# hates_flavor = BerryFlavor.objects.get(pk = int(info[4])),
|
||||
# likes_flavor = BerryFlavor.objects.get(pk = int(info[5])),
|
||||
# game_index = info[6]
|
||||
# )
|
||||
# nature.save()
|
||||
|
||||
|
||||
#Berry/Nature associations
|
||||
data = loadData('berries.csv')
|
||||
# #Berry/Nature associations
|
||||
# data = loadData('berries.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
berry = Berry.objects.get(pk = int(info[0]))
|
||||
berry.nature = Nature.objects.get(pk = int(info[4]))
|
||||
berry.save()
|
||||
# berry = Berry.objects.get(pk = int(info[0]))
|
||||
# berry.nature = Nature.objects.get(pk = int(info[4]))
|
||||
# berry.save()
|
||||
|
||||
|
||||
clearTable(NatureName)
|
||||
data = loadData('nature_names.csv')
|
||||
# clearTable(NatureName)
|
||||
# data = loadData('nature_names.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
natureName = NatureName (
|
||||
nature = Nature.objects.get(pk = int(info[0])),
|
||||
language = Language.objects.get(pk = int(info[1])),
|
||||
name = info[2]
|
||||
)
|
||||
natureName.save()
|
||||
# natureName = NatureName (
|
||||
# nature = Nature.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2]
|
||||
# )
|
||||
# natureName.save()
|
||||
|
||||
|
||||
clearTable(NaturePokeathlonStat)
|
||||
data = loadData('nature_pokeathlon_stats.csv')
|
||||
# clearTable(NaturePokeathlonStat)
|
||||
# data = loadData('nature_pokeathlon_stats.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
naturePokeathlonStat = NaturePokeathlonStat (
|
||||
nature = Nature.objects.get(pk = int(info[0])),
|
||||
pokeathlon_stat = PokeathlonStat.objects.get(pk = int(info[1])),
|
||||
max_change = info[2]
|
||||
)
|
||||
naturePokeathlonStat.save()
|
||||
# naturePokeathlonStat = NaturePokeathlonStat (
|
||||
# nature = Nature.objects.get(pk = int(info[0])),
|
||||
# pokeathlon_stat = PokeathlonStat.objects.get(pk = int(info[1])),
|
||||
# max_change = info[2]
|
||||
# )
|
||||
# naturePokeathlonStat.save()
|
||||
|
||||
|
||||
clearTable(NatureBattleStylePreference)
|
||||
data = loadData('nature_battle_style_preferences.csv')
|
||||
# clearTable(NatureBattleStylePreference)
|
||||
# data = loadData('nature_battle_style_preferences.csv')
|
||||
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
model = NatureBattleStylePreference (
|
||||
nature = Nature.objects.get(pk = int(info[0])),
|
||||
move_battle_style_id = int(info[1]),
|
||||
low_hp_preference = info[2],
|
||||
high_hp_preference = info[3]
|
||||
)
|
||||
model.save()
|
||||
# model = NatureBattleStylePreference (
|
||||
# nature = Nature.objects.get(pk = int(info[0])),
|
||||
# move_battle_style_id = int(info[1]),
|
||||
# low_hp_preference = info[2],
|
||||
# high_hp_preference = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
|
||||
|
||||
|
||||
############
|
||||
# GENDER #
|
||||
############
|
||||
# ###########
|
||||
# # GENDER #
|
||||
# ###########
|
||||
|
||||
# clearTable(Gender)
|
||||
# data = loadData('genders.csv')
|
||||
|
@ -1472,19 +1514,26 @@ for index, info in enumerate(data):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(PokedexName)
|
||||
# clearTable(PokedexDescription)
|
||||
# data = loadData('pokedex_prose.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
|
||||
# model = PokedexDescription (
|
||||
# name_model = PokedexName (
|
||||
# pokedex = Pokedex.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# name = info[2],
|
||||
# )
|
||||
# name_model.save()
|
||||
|
||||
# description_model = PokedexDescription (
|
||||
# pokedex = Pokedex.objects.get(pk = int(info[0])),
|
||||
# language = Language.objects.get(pk = int(info[1])),
|
||||
# description = info[3]
|
||||
# )
|
||||
# model.save()
|
||||
# description_model.save()
|
||||
|
||||
|
||||
# clearTable(PokedexVersionGroup)
|
||||
|
@ -1718,35 +1767,35 @@ for index, info in enumerate(data):
|
|||
# model.save()
|
||||
|
||||
|
||||
# clearTable(PokemonEvolution)
|
||||
# data = loadData('pokemon_evolution.csv')
|
||||
clearTable(PokemonEvolution)
|
||||
data = loadData('pokemon_evolution.csv')
|
||||
|
||||
# for index, info in enumerate(data):
|
||||
# if index > 0:
|
||||
for index, info in enumerate(data):
|
||||
if index > 0:
|
||||
|
||||
# model = PokemonEvolution (
|
||||
# id = int(info[0]),
|
||||
# evolved_species = PokemonSpecies.objects.get(pk = int(info[1])),
|
||||
# evolution_trigger = EvolutionTrigger.objects.get(pk = int(info[2])),
|
||||
# evolution_item = Item.objects.get(pk = int(info[3])) if info[3] != '' else None,
|
||||
# min_level = int(info[4]) if info[4] != '' else None,
|
||||
# gender = Gender.objects.get(pk = int(info[5])) if info[5] != '' else None,
|
||||
# location_id = int(info[6]) if info[6] != '' else None,
|
||||
# held_item = Item.objects.get(pk = int(info[7])) if info[7] != '' else None,
|
||||
# time_of_day = info[8],
|
||||
# known_move = Move.objects.get(pk = int(info[9])) if info[9] != '' else None,
|
||||
# known_move_type = Type.objects.get(pk = int(info[10])) if info[10] != '' else None,
|
||||
# min_happiness = int(info[11]) if info[11] != '' else None,
|
||||
# min_beauty = int(info[12]) if info[12] != '' else None,
|
||||
# min_affection = int(info[13]) if info[13] != '' else None,
|
||||
# relative_physical_stats = int(info[14]) if info[14] != '' else None,
|
||||
# party_species = PokemonSpecies.objects.get(pk = int(info[15])) if info[15] != '' else None,
|
||||
# party_type = Type.objects.get(pk = int(info[16])) if info[16] != '' else None,
|
||||
# trade_species = PokemonSpecies.objects.get(pk = int(info[17])) if info[17] != '' else None,
|
||||
# needs_overworld_rain = bool(int(info[18])),
|
||||
# turn_upside_down = bool(int(info[19]))
|
||||
# )
|
||||
# model.save()
|
||||
model = PokemonEvolution (
|
||||
id = int(info[0]),
|
||||
evolved_species = PokemonSpecies.objects.get(pk = int(info[1])),
|
||||
evolution_trigger = EvolutionTrigger.objects.get(pk = int(info[2])),
|
||||
evolution_item = Item.objects.get(pk = int(info[3])) if info[3] != '' else None,
|
||||
min_level = int(info[4]) if info[4] != '' else None,
|
||||
gender = Gender.objects.get(pk = int(info[5])) if info[5] != '' else None,
|
||||
location = Location.objects.get(pk = int(info[6])) if info[6] != '' else None,
|
||||
held_item = Item.objects.get(pk = int(info[7])) if info[7] != '' else None,
|
||||
time_of_day = info[8],
|
||||
known_move = Move.objects.get(pk = int(info[9])) if info[9] != '' else None,
|
||||
known_move_type = Type.objects.get(pk = int(info[10])) if info[10] != '' else None,
|
||||
min_happiness = int(info[11]) if info[11] != '' else None,
|
||||
min_beauty = int(info[12]) if info[12] != '' else None,
|
||||
min_affection = int(info[13]) if info[13] != '' else None,
|
||||
relative_physical_stats = int(info[14]) if info[14] != '' else None,
|
||||
party_species = PokemonSpecies.objects.get(pk = int(info[15])) if info[15] != '' else None,
|
||||
party_type = Type.objects.get(pk = int(info[16])) if info[16] != '' else None,
|
||||
trade_species = PokemonSpecies.objects.get(pk = int(info[17])) if info[17] != '' else None,
|
||||
needs_overworld_rain = bool(int(info[18])),
|
||||
turn_upside_down = bool(int(info[19]))
|
||||
)
|
||||
model.save()
|
||||
|
||||
|
||||
# clearTable(PokemonForm)
|
||||
|
|
|
@ -5,10 +5,10 @@ from .models import *
|
|||
|
||||
admin.site.register(Ability)
|
||||
admin.site.register(AbilityName)
|
||||
admin.site.register(AbilityDescription)
|
||||
admin.site.register(AbilityEffectText)
|
||||
admin.site.register(AbilityFlavorText)
|
||||
admin.site.register(AbilityChange)
|
||||
admin.site.register(AbilityChangeDescription)
|
||||
admin.site.register(AbilityChangeEffectText)
|
||||
|
||||
admin.site.register(Berry)
|
||||
admin.site.register(BerryFirmness)
|
||||
|
@ -19,7 +19,8 @@ admin.site.register(Characteristic)
|
|||
admin.site.register(CharacteristicDescription)
|
||||
|
||||
admin.site.register(ContestCombo)
|
||||
admin.site.register(ContestEffectDescription)
|
||||
admin.site.register(ContestEffectEffectText)
|
||||
admin.site.register(ContestEffectFlavorText)
|
||||
admin.site.register(ContestEffect)
|
||||
admin.site.register(ContestType)
|
||||
admin.site.register(ContestTypeName)
|
||||
|
@ -63,7 +64,7 @@ admin.site.register(ItemGameIndex)
|
|||
admin.site.register(ItemName)
|
||||
admin.site.register(ItemPocketName)
|
||||
admin.site.register(ItemPocket)
|
||||
admin.site.register(ItemDescription)
|
||||
admin.site.register(ItemEffectText)
|
||||
admin.site.register(Item)
|
||||
|
||||
admin.site.register(Language)
|
||||
|
@ -84,12 +85,13 @@ admin.site.register(MoveChange)
|
|||
admin.site.register(MoveDamageClass)
|
||||
admin.site.register(MoveDamageClassDescription)
|
||||
admin.site.register(MoveEffectChange)
|
||||
admin.site.register(MoveEffectChangeDescription)
|
||||
admin.site.register(MoveEffectDescription)
|
||||
admin.site.register(MoveEffectChangeEffectText)
|
||||
admin.site.register(MoveEffectEffectText)
|
||||
admin.site.register(MoveEffect)
|
||||
admin.site.register(MoveFlagMap)
|
||||
admin.site.register(MoveFlagDescription)
|
||||
admin.site.register(MoveFlag)
|
||||
admin.site.register(MoveAttributeDescription)
|
||||
admin.site.register(MoveAttributeMap)
|
||||
admin.site.register(MoveAttributeName)
|
||||
admin.site.register(MoveAttribute)
|
||||
admin.site.register(MoveFlavorText)
|
||||
admin.site.register(MoveLearnMethod)
|
||||
admin.site.register(MoveLearnMethodName)
|
||||
|
@ -152,7 +154,7 @@ admin.site.register(Stat)
|
|||
|
||||
admin.site.register(SuperContestEffect)
|
||||
admin.site.register(SuperContestCombo)
|
||||
admin.site.register(SuperContestEffectDescription)
|
||||
admin.site.register(SuperContestEffectFlavorText)
|
||||
|
||||
admin.site.register(Type)
|
||||
admin.site.register(TypeName)
|
||||
|
|
|
@ -6,7 +6,7 @@ from django.db import models, migrations
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
# replaces = [(b'pokemon_v2', '0001_squashed_0013_auto_20150926_0913'), (b'pokemon_v2', '0002_itemflingeffect_name'), (b'pokemon_v2', '0003_auto_20150928_1710'), (b'pokemon_v2', '0004_auto_20151005_0138')]
|
||||
# replaces = [(b'pokemon_v2', '0001_squashed_0004_auto_20151005_0138'), (b'pokemon_v2', '0002_auto_20151016_0523'), (b'pokemon_v2', '0003_auto_20151022_1725'), (b'pokemon_v2', '0004_auto_20151022_1729'), (b'pokemon_v2', '0005_auto_20151022_1917'), (b'pokemon_v2', '0006_auto_20151023_0135'), (b'pokemon_v2', '0007_berry_name'), (b'pokemon_v2', '0008_auto_20151023_1735'), (b'pokemon_v2', '0009_auto_20151023_2134'), (b'pokemon_v2', '0010_auto_20151024_0252'), (b'pokemon_v2', '0011_auto_20151024_0322'), (b'pokemon_v2', '0012_auto_20151024_0340'), (b'pokemon_v2', '0013_auto_20151024_0345'), (b'pokemon_v2', '0014_auto_20151024_0350'), (b'pokemon_v2', '0015_auto_20151024_0434'), (b'pokemon_v2', '0016_auto_20151024_1942'), (b'pokemon_v2', '0017_auto_20151024_2015'), (b'pokemon_v2', '0018_auto_20151024_2021'), (b'pokemon_v2', '0019_auto_20151024_2030'), (b'pokemon_v2', '0020_auto_20151024_2200'), (b'pokemon_v2', '0021_auto_20151025_1634'), (b'pokemon_v2', '0022_auto_20151025_1725'), (b'pokemon_v2', '0023_auto_20151025_1910'), (b'pokemon_v2', '0024_auto_20151027_0023')]
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
@ -30,7 +30,6 @@ class Migration(migrations.Migration):
|
|||
name='LanguageName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('local_language_id', models.IntegerField()),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='languagename_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
|
@ -75,19 +74,6 @@ class Migration(migrations.Migration):
|
|||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AbilityDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('ability', models.ForeignKey(blank=True, to='pokemon_v2.Ability', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AbilityFlavorText',
|
||||
fields=[
|
||||
|
@ -155,7 +141,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='versionname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('version', models.ForeignKey(blank=True, to='pokemon_v2.Version', null=True)),
|
||||
('version', models.ForeignKey(related_name='versionname', blank=True, to='pokemon_v2.Version', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -262,7 +248,7 @@ class Migration(migrations.Migration):
|
|||
('move_battle_style_id', models.IntegerField()),
|
||||
('low_hp_preference', models.IntegerField()),
|
||||
('high_hp_preference', models.IntegerField()),
|
||||
('nature', models.ForeignKey(blank=True, to='pokemon_v2.Nature', null=True)),
|
||||
('nature', models.ForeignKey(related_name='naturebattlestylepreference', blank=True, to='pokemon_v2.Nature', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -289,7 +275,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='statname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('stat', models.ForeignKey(blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
('stat', models.ForeignKey(related_name='statname', blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -318,7 +304,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='naturename_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('nature', models.ForeignKey(blank=True, to='pokemon_v2.Nature', null=True)),
|
||||
('nature', models.ForeignKey(related_name='naturename', blank=True, to='pokemon_v2.Nature', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -486,9 +472,8 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movedamageclassdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_damage_class', models.ForeignKey(blank=True, to='pokemon_v2.MoveDamageClass', null=True)),
|
||||
('move_damage_class', models.ForeignKey(related_name='movedamageclassdescription', blank=True, to='pokemon_v2.MoveDamageClass', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -509,7 +494,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('move_effect', models.ForeignKey(blank=True, to='pokemon_v2.MoveEffect', null=True)),
|
||||
('version_group', models.ForeignKey(blank=True, to='pokemon_v2.VersionGroup', null=True)),
|
||||
('version_group', models.ForeignKey(related_name='moveeffectchange', blank=True, to='pokemon_v2.VersionGroup', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -517,63 +502,10 @@ class Migration(migrations.Migration):
|
|||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveEffectChangeDescription',
|
||||
name='MoveAttribute',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('language', models.ForeignKey(related_name='moveeffectchangedescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_effect_change', models.ForeignKey(blank=True, to='pokemon_v2.MoveEffectChange', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveEffectDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('language', models.ForeignKey(related_name='moveeffectdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_effect', models.ForeignKey(blank=True, to='pokemon_v2.MoveEffect', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveFlag',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=30)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveFlagDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='moveflagdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_flag', models.ForeignKey(blank=True, to='pokemon_v2.MoveFlag', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveFlagMap',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('move', models.ForeignKey(related_name='moveflagmap', blank=True, to='pokemon_v2.Move', null=True)),
|
||||
('move_flag', models.ForeignKey(blank=True, to='pokemon_v2.MoveFlag', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -631,7 +563,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movemetaailmentname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_meta_ailment', models.ForeignKey(blank=True, to='pokemon_v2.MoveMetaAilment', null=True)),
|
||||
('move_meta_ailment', models.ForeignKey(related_name='movemetaailmentname', blank=True, to='pokemon_v2.MoveMetaAilment', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -655,7 +587,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('language', models.ForeignKey(related_name='movemetacategorydescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_meta_category', models.ForeignKey(blank=True, to='pokemon_v2.MoveMetaCategory', null=True)),
|
||||
('move_meta_category', models.ForeignKey(related_name='movemetacategorydescription', blank=True, to='pokemon_v2.MoveMetaCategory', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -668,7 +600,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('change', models.IntegerField()),
|
||||
('move', models.ForeignKey(related_name='movemetastatchange', blank=True, to='pokemon_v2.Move', null=True)),
|
||||
('stat', models.ForeignKey(blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
('stat', models.ForeignKey(related_name='movemetastatchange', blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -704,9 +636,8 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movetargetdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_target', models.ForeignKey(blank=True, to='pokemon_v2.MoveTarget', null=True)),
|
||||
('move_target', models.ForeignKey(related_name='movetargetdescription', blank=True, to='pokemon_v2.MoveTarget', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -716,7 +647,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='movemeta',
|
||||
name='move_meta_category',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.MoveMetaCategory', null=True),
|
||||
field=models.ForeignKey(related_name='movemeta', blank=True, to='pokemon_v2.MoveMetaCategory', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
|
@ -728,7 +659,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='movemeta',
|
||||
name='move_meta_ailment',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.MoveMetaAilment', null=True),
|
||||
field=models.ForeignKey(related_name='movemeta', blank=True, to='pokemon_v2.MoveMetaAilment', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
|
@ -905,12 +836,6 @@ class Migration(migrations.Migration):
|
|||
field=models.CharField(max_length=40),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='moveflag',
|
||||
name='name',
|
||||
field=models.CharField(max_length=40),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='movemetaailment',
|
||||
name='name',
|
||||
|
@ -1013,12 +938,6 @@ class Migration(migrations.Migration):
|
|||
field=models.CharField(max_length=100),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='moveflag',
|
||||
name='name',
|
||||
field=models.CharField(max_length=100),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='movemetaailment',
|
||||
name='name',
|
||||
|
@ -1203,20 +1122,7 @@ class Migration(migrations.Migration):
|
|||
name='AbilityChange',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('ability', models.ForeignKey(blank=True, to='pokemon_v2.Ability', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AbilityChangeDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('ability_change', models.ForeignKey(blank=True, to='pokemon_v2.AbilityChange', null=True)),
|
||||
('language', models.ForeignKey(related_name='abilitychangedescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('ability', models.ForeignKey(related_name='abilitychange', blank=True, to='pokemon_v2.Ability', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1299,7 +1205,6 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='pokedexdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('pokedex', models.ForeignKey(related_name='pokedexdescription', blank=True, to='pokemon_v2.Pokedex', null=True)),
|
||||
],
|
||||
|
@ -1367,7 +1272,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='pokemoncolorname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('pokemon_color', models.ForeignKey(blank=True, to='pokemon_v2.PokemonColor', null=True)),
|
||||
('pokemon_color', models.ForeignKey(related_name='pokemoncolorname', blank=True, to='pokemon_v2.PokemonColor', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1443,7 +1348,7 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('game_index', models.IntegerField()),
|
||||
('generation', models.ForeignKey(related_name='pokemonformgeneration', blank=True, to='pokemon_v2.Generation', null=True)),
|
||||
('pokemon_form', models.ForeignKey(blank=True, to='pokemon_v2.PokemonForm', null=True)),
|
||||
('pokemon_form', models.ForeignKey(related_name='pokemonformgeneration', blank=True, to='pokemon_v2.PokemonForm', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1457,7 +1362,7 @@ class Migration(migrations.Migration):
|
|||
('name', models.CharField(max_length=100)),
|
||||
('pokemon_name', models.CharField(max_length=30)),
|
||||
('language', models.ForeignKey(related_name='pokemonformname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('pokemon_form', models.ForeignKey(blank=True, to='pokemon_v2.PokemonForm', null=True)),
|
||||
('pokemon_form', models.ForeignKey(related_name='pokemonformname', blank=True, to='pokemon_v2.PokemonForm', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1544,10 +1449,9 @@ class Migration(migrations.Migration):
|
|||
name='MoveLearnMethodName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movelearnmethodname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_learn_method', models.ForeignKey(blank=True, to='pokemon_v2.MoveLearnMethod', null=True)),
|
||||
('move_learn_method', models.ForeignKey(related_name='movelearnmethodname', blank=True, to='pokemon_v2.MoveLearnMethod', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1653,7 +1557,7 @@ class Migration(migrations.Migration):
|
|||
('base_stat', models.IntegerField()),
|
||||
('effort', models.IntegerField()),
|
||||
('pokemon', models.ForeignKey(related_name='pokemonstat', blank=True, to='pokemon_v2.Pokemon', null=True)),
|
||||
('stat', models.ForeignKey(blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
('stat', models.ForeignKey(related_name='pokemonstat', blank=True, to='pokemon_v2.Stat', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -1789,11 +1693,9 @@ class Migration(migrations.Migration):
|
|||
model_name='pokemonevolution',
|
||||
name='held_item_id',
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.RemoveField(
|
||||
model_name='pokemonevolution',
|
||||
name='location_id',
|
||||
field=models.IntegerField(null=True, blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pokemonevolution',
|
||||
|
@ -1924,21 +1826,7 @@ class Migration(migrations.Migration):
|
|||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('item', models.ForeignKey(blank=True, to='pokemon_v2.Item', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemFlag',
|
||||
name='ItemAttribute',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
|
@ -1948,32 +1836,6 @@ class Migration(migrations.Migration):
|
|||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemFlagDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('item_flag', models.ForeignKey(blank=True, to='pokemon_v2.ItemFlag', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemflagdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemFlagMap',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('item', models.ForeignKey(related_name='itemflagmap', blank=True, to='pokemon_v2.Item', null=True)),
|
||||
('item_flag', models.ForeignKey(blank=True, to='pokemon_v2.ItemFlag', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemFlavorText',
|
||||
fields=[
|
||||
|
@ -2001,9 +1863,9 @@ class Migration(migrations.Migration):
|
|||
name='ItemFlingEffectDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('item_fling_effect', models.ForeignKey(related_name='itemflingeffectdescription', blank=True, to='pokemon_v2.ItemFlingEffect', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemflingeffectdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -2140,7 +2002,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('berry_firmness', models.ForeignKey(blank=True, to='pokemon_v2.BerryFirmness', null=True)),
|
||||
('berry_firmness', models.ForeignKey(related_name='berryfirmnessname', blank=True, to='pokemon_v2.BerryFirmness', null=True)),
|
||||
('language', models.ForeignKey(related_name='berryfirmnessname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
|
@ -2182,20 +2044,6 @@ class Migration(migrations.Migration):
|
|||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContestEffectDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('flavor_text', models.CharField(max_length=500)),
|
||||
('contest_effect', models.ForeignKey(blank=True, to='pokemon_v2.ContestEffect', null=True)),
|
||||
('language', models.ForeignKey(related_name='contesteffectdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContestType',
|
||||
fields=[
|
||||
|
@ -2243,27 +2091,31 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='berry',
|
||||
name='nature',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.Nature', null=True),
|
||||
field=models.ForeignKey(related_name='berry', blank=True, to='pokemon_v2.Nature', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='nature',
|
||||
old_name='hates_flavor_id',
|
||||
new_name='hates_flavor',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nature',
|
||||
name='hates_flavor_id',
|
||||
name='hates_flavor',
|
||||
field=models.ForeignKey(related_name='hates_flavor', blank=True, to='pokemon_v2.BerryFlavor', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='nature',
|
||||
old_name='likes_flavor_id',
|
||||
new_name='likes_flavor',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nature',
|
||||
name='likes_flavor_id',
|
||||
name='likes_flavor',
|
||||
field=models.ForeignKey(related_name='likes_flavor', blank=True, to='pokemon_v2.BerryFlavor', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='abilitydescription',
|
||||
name='language',
|
||||
field=models.ForeignKey(related_name='abilitydescription_language', blank=True, to='pokemon_v2.Language', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Region',
|
||||
fields=[
|
||||
|
@ -2599,19 +2451,6 @@ class Migration(migrations.Migration):
|
|||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SuperContestEffectDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('flavor_text', models.CharField(max_length=500)),
|
||||
('language', models.ForeignKey(related_name='supercontesteffectdescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('super_contest_effect', models.ForeignKey(blank=True, to='pokemon_v2.SuperContestEffect', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='palpark',
|
||||
name='pal_park_area',
|
||||
|
@ -2636,42 +2475,12 @@ class Migration(migrations.Migration):
|
|||
field=models.IntegerField(null=True, blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilitydescription',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='descriptions', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilitychange',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='abilitychange_descriptions', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilitydescription',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='abilitydescription_descriptions', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilityflavortext',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='abilityflavortext_descriptions', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilitychange',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='abilitychange', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilitydescription',
|
||||
name='ability',
|
||||
field=models.ForeignKey(related_name='abilitydescription', blank=True, to='pokemon_v2.Ability', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilityflavortext',
|
||||
name='ability',
|
||||
|
@ -2744,12 +2553,6 @@ class Migration(migrations.Migration):
|
|||
field=models.ForeignKey(related_name='move', blank=True, to='pokemon_v2.Type', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='moveeffectchange',
|
||||
name='version_group',
|
||||
field=models.ForeignKey(related_name='moveeffectchange', blank=True, to='pokemon_v2.VersionGroup', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pokemonitem',
|
||||
name='version',
|
||||
|
@ -2895,14 +2698,14 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='pokemonmove',
|
||||
name='move_learn_method',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.MoveLearnMethod', null=True),
|
||||
field=models.ForeignKey(related_name='pokemonmove', blank=True, to='pokemon_v2.MoveLearnMethod', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='VersionGroupMoveLearnMethod',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('move_learn_method', models.ForeignKey(blank=True, to='pokemon_v2.MoveLearnMethod', null=True)),
|
||||
('move_learn_method', models.ForeignKey(related_name='versiongroupmovelearnmethod', blank=True, to='pokemon_v2.MoveLearnMethod', null=True)),
|
||||
('version_group', models.ForeignKey(related_name='versiongroupmovelearnmethod', blank=True, to='pokemon_v2.VersionGroup', null=True)),
|
||||
],
|
||||
options={
|
||||
|
@ -2916,4 +2719,321 @@ class Migration(migrations.Migration):
|
|||
field=models.CharField(default='name', max_length=100),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemAttributeDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('item_attribute', models.ForeignKey(related_name='itemattributedescription', blank=True, to='pokemon_v2.ItemAttribute', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemattributedescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemAttributeMap',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('item', models.ForeignKey(related_name='itemattributemap', blank=True, to='pokemon_v2.Item', null=True)),
|
||||
('item_attribute', models.ForeignKey(related_name='itemattributemap', blank=True, to='pokemon_v2.ItemAttribute', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='berry',
|
||||
name='name',
|
||||
field=models.CharField(default='name', max_length=100),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='languagename',
|
||||
name='local_language',
|
||||
field=models.ForeignKey(related_name='locallanguage', blank=True, to='pokemon_v2.Language', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='naturepokeathlonstat',
|
||||
name='nature',
|
||||
field=models.ForeignKey(related_name='naturepokeathlonstat', blank=True, to='pokemon_v2.Nature', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemAttributeName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('item_attribute', models.ForeignKey(related_name='itemattributename', blank=True, to='pokemon_v2.ItemAttribute', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemattributename_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveAttributeDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('language', models.ForeignKey(related_name='moveattributedescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_attribute', models.ForeignKey(blank=True, to='pokemon_v2.MoveAttribute', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveAttributeMap',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('move', models.ForeignKey(related_name='moveattributemap', blank=True, to='pokemon_v2.Move', null=True)),
|
||||
('move_attribute', models.ForeignKey(blank=True, to='pokemon_v2.MoveAttribute', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveAttributeName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='moveattributename_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_attribute', models.ForeignKey(blank=True, to='pokemon_v2.MoveAttribute', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveDamageClassName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movedamageclassname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_damage_class', models.ForeignKey(related_name='movedamageclassname', blank=True, to='pokemon_v2.MoveDamageClass', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveTargetName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='movetargetname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_target', models.ForeignKey(related_name='movetargetname', blank=True, to='pokemon_v2.MoveTarget', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PokedexName',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('language', models.ForeignKey(related_name='pokedexname_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('pokedex', models.ForeignKey(related_name='pokedexname', blank=True, to='pokemon_v2.Pokedex', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveLearnMethodDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('language', models.ForeignKey(related_name='movelearnmethoddescription_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_learn_method', models.ForeignKey(related_name='movelearnmethoddescription', blank=True, to='pokemon_v2.MoveLearnMethod', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='move',
|
||||
name='move_damage_class',
|
||||
field=models.ForeignKey(related_name='move', blank=True, to='pokemon_v2.MoveDamageClass', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='stat',
|
||||
name='move_damage_class',
|
||||
field=models.ForeignKey(related_name='stat', blank=True, to='pokemon_v2.MoveDamageClass', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='type',
|
||||
name='move_damage_class',
|
||||
field=models.ForeignKey(related_name='type', blank=True, to='pokemon_v2.MoveDamageClass', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='move',
|
||||
name='move_target',
|
||||
field=models.ForeignKey(related_name='move', blank=True, to='pokemon_v2.MoveTarget', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AbilityChangeEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('ability_change', models.ForeignKey(blank=True, to='pokemon_v2.AbilityChange', null=True)),
|
||||
('language', models.ForeignKey(related_name='abilitychangeeffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AbilityEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('ability', models.ForeignKey(related_name='abilityeffecttext', blank=True, to='pokemon_v2.Ability', null=True)),
|
||||
('language', models.ForeignKey(related_name='abilityeffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('item', models.ForeignKey(related_name='itemeffecttext', blank=True, to='pokemon_v2.Item', null=True)),
|
||||
('language', models.ForeignKey(related_name='itemeffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContestEffectEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('contest_effect', models.ForeignKey(related_name='contesteffecteffecttext', blank=True, to='pokemon_v2.ContestEffect', null=True)),
|
||||
('language', models.ForeignKey(related_name='contesteffecteffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveEffectChangeEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('language', models.ForeignKey(related_name='moveeffectchangeeffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_effect_change', models.ForeignKey(blank=True, to='pokemon_v2.MoveEffectChange', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MoveEffectEffectText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('effect', models.CharField(max_length=4000)),
|
||||
('short_effect', models.CharField(max_length=300)),
|
||||
('language', models.ForeignKey(related_name='moveeffecteffecttext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('move_effect', models.ForeignKey(blank=True, to='pokemon_v2.MoveEffect', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SuperContestEffectFlavorText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('flavor_text', models.CharField(max_length=500)),
|
||||
('language', models.ForeignKey(related_name='supercontesteffectflavortext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
('super_contest_effect', models.ForeignKey(blank=True, to='pokemon_v2.SuperContestEffect', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ContestEffectFlavorText',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('flavor_text', models.CharField(max_length=500)),
|
||||
('contest_effect', models.ForeignKey(related_name='contesteffectflavortext', blank=True, to='pokemon_v2.ContestEffect', null=True)),
|
||||
('language', models.ForeignKey(related_name='contesteffectflavortext_language', blank=True, to='pokemon_v2.Language', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='characteristic',
|
||||
name='stat',
|
||||
field=models.ForeignKey(related_name='characteristic', blank=True, to='pokemon_v2.Stat', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='nature',
|
||||
old_name='decreased_stat_id',
|
||||
new_name='decreased_stat',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='nature',
|
||||
old_name='increased_stat_id',
|
||||
new_name='increased_stat',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pokemonspecies',
|
||||
name='pokemon_color',
|
||||
field=models.ForeignKey(related_name='pokemonspecies', blank=True, to='pokemon_v2.PokemonColor', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pokemonspecies',
|
||||
name='pokemon_shape',
|
||||
field=models.ForeignKey(related_name='pokemonspecies', blank=True, to='pokemon_v2.PokemonShape', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pokemonevolution',
|
||||
name='location',
|
||||
field=models.ForeignKey(related_name='location', blank=True, to='pokemon_v2.Location', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pokemonspecies',
|
||||
name='pokemon_shape',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.PokemonShape', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -1,20 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0001_squashed_0004_auto_20151005_0138'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='versionname',
|
||||
name='version',
|
||||
field=models.ForeignKey(related_name='versionname', blank=True, to='pokemon_v2.Version', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -1,81 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0002_auto_20151016_0523'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ItemAttributeDescription',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('description', models.CharField(default='', max_length=1000)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ItemAttributeMap',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('item', models.ForeignKey(related_name='itemattributemap', blank=True, to='pokemon_v2.Item', null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.RenameModel(
|
||||
old_name='ItemFlag',
|
||||
new_name='ItemAttribute',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='itemflagdescription',
|
||||
name='item_flag',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='itemflagdescription',
|
||||
name='language',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='ItemFlagDescription',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='itemflagmap',
|
||||
name='item',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='itemflagmap',
|
||||
name='item_flag',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='ItemFlagMap',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='itemattributemap',
|
||||
name='item_attribute',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.ItemAttribute', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='itemattributedescription',
|
||||
name='item_flag',
|
||||
field=models.ForeignKey(blank=True, to='pokemon_v2.ItemAttribute', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='itemattributedescription',
|
||||
name='language',
|
||||
field=models.ForeignKey(related_name='itemattributedescription_language', blank=True, to='pokemon_v2.Language', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0003_auto_20151022_1725'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='itemattributedescription',
|
||||
old_name='item_flag',
|
||||
new_name='item_attribute',
|
||||
),
|
||||
]
|
|
@ -1,24 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0004_auto_20151022_1729'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='itemflingeffectdescription',
|
||||
name='effect',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='itemflingeffectdescription',
|
||||
name='description',
|
||||
field=models.CharField(default='', max_length=1000),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -1,20 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0005_auto_20151022_1917'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='berryfirmnessname',
|
||||
name='berry_firmness',
|
||||
field=models.ForeignKey(related_name='berryfirmnessname', blank=True, to='pokemon_v2.BerryFirmness', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -1,20 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pokemon_v2', '0006_auto_20151023_0135'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='berry',
|
||||
name='name',
|
||||
field=models.CharField(default='name', max_length=100),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -134,6 +134,14 @@ class HasItem(models.Model):
|
|||
abstract = True
|
||||
|
||||
|
||||
class HasItemAttribute(models.Model):
|
||||
|
||||
item_attribute = models.ForeignKey('ItemAttribute', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
class HasItemCategory(models.Model):
|
||||
|
||||
item_category = models.ForeignKey('ItemCategory', blank=True, null=True, related_name="%(class)s")
|
||||
|
@ -176,7 +184,7 @@ class HasLocationArea(models.Model):
|
|||
|
||||
class HasMetaAilment(models.Model):
|
||||
|
||||
move_meta_ailment = models.ForeignKey('MoveMetaAilment', blank = True, null = True)
|
||||
move_meta_ailment = models.ForeignKey('MoveMetaAilment', blank = True, null = True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -184,7 +192,7 @@ class HasMetaAilment(models.Model):
|
|||
|
||||
class HasMetaCategory(models.Model):
|
||||
|
||||
move_meta_category = models.ForeignKey('MoveMetaCategory', blank = True, null = True)
|
||||
move_meta_category = models.ForeignKey('MoveMetaCategory', blank = True, null = True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -200,7 +208,7 @@ class HasMove(models.Model):
|
|||
|
||||
class HasMoveDamageClass(models.Model):
|
||||
|
||||
move_damage_class = models.ForeignKey('MoveDamageClass', blank = True, null = True)
|
||||
move_damage_class = models.ForeignKey('MoveDamageClass', blank = True, null = True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -214,9 +222,9 @@ class HasMoveEffect(models.Model):
|
|||
abstract = True
|
||||
|
||||
|
||||
class HasMoveFlag(models.Model):
|
||||
class HasMoveAttribute(models.Model):
|
||||
|
||||
move_flag = models.ForeignKey('MoveFlag', blank = True, null = True)
|
||||
move_attribute = models.ForeignKey('MoveAttribute', blank = True, null = True)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -224,7 +232,7 @@ class HasMoveFlag(models.Model):
|
|||
|
||||
class HasMoveTarget(models.Model):
|
||||
|
||||
move_target = models.ForeignKey('MoveTarget', blank = True, null = True)
|
||||
move_target = models.ForeignKey('MoveTarget', blank = True, null = True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -240,7 +248,7 @@ class HasName(models.Model):
|
|||
|
||||
class HasNature(models.Model):
|
||||
|
||||
nature = models.ForeignKey('Nature', blank=True, null=True)
|
||||
nature = models.ForeignKey('Nature', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -280,7 +288,7 @@ class HasPokemon(models.Model):
|
|||
|
||||
class HasPokemonColor(models.Model):
|
||||
|
||||
pokemon_color = models.ForeignKey('PokemonColor', blank=True, null=True)
|
||||
pokemon_color = models.ForeignKey('PokemonColor', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -288,7 +296,7 @@ class HasPokemonColor(models.Model):
|
|||
|
||||
class HasPokemonForm(models.Model):
|
||||
|
||||
pokemon_form = models.ForeignKey('PokemonForm', blank=True, null=True)
|
||||
pokemon_form = models.ForeignKey('PokemonForm', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -296,7 +304,7 @@ class HasPokemonForm(models.Model):
|
|||
|
||||
class HasPokemonHabitat(models.Model):
|
||||
|
||||
pokemon_habitat = models.ForeignKey('PokemonHabitat', blank=True, null=True)
|
||||
pokemon_habitat = models.ForeignKey('PokemonHabitat', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -305,7 +313,7 @@ class HasPokemonHabitat(models.Model):
|
|||
#HasPokemonMoveMethod
|
||||
class HasMoveLearnMethod(models.Model):
|
||||
|
||||
move_learn_method = models.ForeignKey('MoveLearnMethod', blank=True, null=True)
|
||||
move_learn_method = models.ForeignKey('MoveLearnMethod', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -313,7 +321,7 @@ class HasMoveLearnMethod(models.Model):
|
|||
|
||||
class HasPokemonShape(models.Model):
|
||||
|
||||
pokemon_shape = models.ForeignKey('PokemonShape', blank=True, null=True)
|
||||
pokemon_shape = models.ForeignKey('PokemonShape', blank=True, null=True, )
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -345,7 +353,7 @@ class HasShortEffect(models.Model):
|
|||
|
||||
class HasStat(models.Model):
|
||||
|
||||
stat = models.ForeignKey('Stat', blank=True, null=True)
|
||||
stat = models.ForeignKey('Stat', blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -433,7 +441,7 @@ class Language(HasName, HasOrder):
|
|||
|
||||
class LanguageName(IsName):
|
||||
|
||||
local_language_id = models.IntegerField()
|
||||
local_language = models.ForeignKey('Language', blank = True, null = True, related_name="locallanguage")
|
||||
|
||||
|
||||
|
||||
|
@ -472,7 +480,7 @@ class Ability(HasName, HasGeneration):
|
|||
is_main_series = models.BooleanField(default = False)
|
||||
|
||||
|
||||
class AbilityDescription(HasLanguage, HasEffect, HasShortEffect, HasAbility):
|
||||
class AbilityEffectText(HasLanguage, HasEffect, HasShortEffect, HasAbility):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -488,7 +496,7 @@ class AbilityChange(HasAbility):
|
|||
pass
|
||||
|
||||
|
||||
class AbilityChangeDescription(HasLanguage, HasEffect):
|
||||
class AbilityChangeEffectText(HasLanguage, HasEffect):
|
||||
|
||||
ability_change = models.ForeignKey(AbilityChange, blank=True, null=True)
|
||||
|
||||
|
@ -598,9 +606,8 @@ class Item(HasName, HasItemCategory, HasFlingEffect):
|
|||
fling_power = models.IntegerField(blank=True, null=True)
|
||||
|
||||
|
||||
class ItemDescription(HasLanguage, HasEffect, HasShortEffect):
|
||||
|
||||
item = models.ForeignKey(Item, blank=True, null=True)
|
||||
class ItemEffectText(HasItem, HasLanguage, HasEffect, HasShortEffect):
|
||||
pass
|
||||
|
||||
|
||||
class ItemName(HasItem, IsName):
|
||||
|
@ -615,14 +622,16 @@ class ItemAttribute(HasName):
|
|||
pass
|
||||
|
||||
|
||||
class ItemAttributeDescription(IsDescription, HasName):
|
||||
|
||||
item_attribute = models.ForeignKey(ItemAttribute, blank=True, null=True)
|
||||
class ItemAttributeName(IsName, HasItemAttribute):
|
||||
pass
|
||||
|
||||
|
||||
class ItemAttributeMap(HasItem):
|
||||
class ItemAttributeDescription(IsDescription, HasItemAttribute):
|
||||
pass
|
||||
|
||||
item_attribute = models.ForeignKey(ItemAttribute, blank=True, null=True)
|
||||
|
||||
class ItemAttributeMap(HasItem, HasItemAttribute):
|
||||
pass
|
||||
|
||||
|
||||
class ItemGameIndex(HasItem, HasGeneration, HasGameIndex):
|
||||
|
@ -652,9 +661,14 @@ class ContestEffect(models.Model):
|
|||
jam = models.IntegerField()
|
||||
|
||||
|
||||
class ContestEffectDescription(HasLanguage, HasEffect, HasFlavorText):
|
||||
class ContestEffectEffectText(HasLanguage, HasEffect):
|
||||
|
||||
contest_effect = models.ForeignKey(ContestEffect, blank=True, null=True)
|
||||
contest_effect = models.ForeignKey(ContestEffect, blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
|
||||
class ContestEffectFlavorText(HasLanguage, HasFlavorText):
|
||||
|
||||
contest_effect = models.ForeignKey(ContestEffect, blank=True, null=True, related_name="%(class)s")
|
||||
|
||||
|
||||
class ContestCombo(models.Model):
|
||||
|
@ -723,13 +737,13 @@ class GrowthRateDescription(HasGrowthRate, IsDescription):
|
|||
|
||||
class Nature(HasName):
|
||||
|
||||
decreased_stat_id = models.ForeignKey(Stat, blank = True, null = True, related_name = 'decreased')
|
||||
decreased_stat = models.ForeignKey(Stat, blank = True, null = True, related_name = 'decreased')
|
||||
|
||||
increased_stat_id = models.ForeignKey(Stat, blank = True, null = True, related_name = 'increased')
|
||||
increased_stat = models.ForeignKey(Stat, blank = True, null = True, related_name = 'increased')
|
||||
|
||||
hates_flavor_id = models.ForeignKey(BerryFlavor, blank = True, null = True, related_name = 'hates_flavor')
|
||||
hates_flavor = models.ForeignKey(BerryFlavor, blank = True, null = True, related_name = 'hates_flavor')
|
||||
|
||||
likes_flavor_id = models.ForeignKey(BerryFlavor, blank = True, null = True, related_name = 'likes_flavor')
|
||||
likes_flavor = models.ForeignKey(BerryFlavor, blank = True, null = True, related_name = 'likes_flavor')
|
||||
|
||||
game_index = models.IntegerField()
|
||||
|
||||
|
@ -887,8 +901,10 @@ class MoveChange(HasMove, HasVersionGroup, HasType, HasMoveEffect):
|
|||
class MoveDamageClass(HasName):
|
||||
pass
|
||||
|
||||
class MoveDamageClassName(HasMoveDamageClass, IsName):
|
||||
pass
|
||||
|
||||
class MoveDamageClassDescription(HasMoveDamageClass, IsDescription, HasName):
|
||||
class MoveDamageClassDescription(HasMoveDamageClass, IsDescription):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -915,7 +931,7 @@ class MoveEffect(models.Model):
|
|||
pass
|
||||
|
||||
|
||||
class MoveEffectDescription(HasLanguage, HasMoveEffect, HasEffect, HasShortEffect):
|
||||
class MoveEffectEffectText(HasLanguage, HasMoveEffect, HasEffect, HasShortEffect):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -923,25 +939,29 @@ class MoveEffectChange(HasMoveEffect, HasVersionGroup):
|
|||
pass
|
||||
|
||||
|
||||
class MoveEffectChangeDescription(HasLanguage, HasEffect):
|
||||
class MoveEffectChangeEffectText(HasLanguage, HasEffect):
|
||||
|
||||
move_effect_change = models.ForeignKey('MoveEffectChange', blank = True, null = True)
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# MOVE FLAG MODELS #
|
||||
######################
|
||||
################################
|
||||
# MOVE FLAG/ATTRIBUTE MODELS #
|
||||
################################
|
||||
|
||||
class MoveFlag(HasName):
|
||||
class MoveAttribute(HasName):
|
||||
pass
|
||||
|
||||
|
||||
class MoveFlagDescription(HasMoveFlag, HasName, IsDescription):
|
||||
class MoveAttributeName(HasMoveAttribute, IsName):
|
||||
pass
|
||||
|
||||
|
||||
class MoveFlagMap(HasMove, HasMoveFlag):
|
||||
class MoveAttributeDescription(HasMoveAttribute, IsDescription):
|
||||
pass
|
||||
|
||||
|
||||
class MoveAttributeMap(HasMove, HasMoveAttribute):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -954,7 +974,11 @@ class MoveTarget(HasName):
|
|||
pass
|
||||
|
||||
|
||||
class MoveTargetDescription(HasMoveTarget, IsDescription, HasName):
|
||||
class MoveTargetName(HasMoveTarget, IsName):
|
||||
pass
|
||||
|
||||
|
||||
class MoveTargetDescription(HasMoveTarget, IsDescription):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1090,7 +1114,7 @@ class SuperContestEffect(models.Model):
|
|||
appeal = models.IntegerField()
|
||||
|
||||
|
||||
class SuperContestEffectDescription(IsFlavorText):
|
||||
class SuperContestEffectFlavorText(IsFlavorText):
|
||||
|
||||
super_contest_effect = models.ForeignKey(SuperContestEffect, blank = True, null = True)
|
||||
|
||||
|
@ -1130,7 +1154,11 @@ class Pokedex(HasName, HasRegion):
|
|||
is_main_series = models.BooleanField(default = False)
|
||||
|
||||
|
||||
class PokedexDescription(HasPokedex, HasName, IsDescription):
|
||||
class PokedexName(HasPokedex, IsName):
|
||||
pass
|
||||
|
||||
|
||||
class PokedexDescription(HasPokedex, IsDescription):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1223,7 +1251,7 @@ class PokemonEvolution(HasEvolutionTrigger, HasGender):
|
|||
|
||||
min_level = models.IntegerField(blank=True, null=True)
|
||||
|
||||
location_id = models.IntegerField(blank=True, null=True) # need location tables
|
||||
location = models.ForeignKey(Location, related_name="location", blank=True, null=True)
|
||||
|
||||
held_item = models.ForeignKey(Item, blank=True, null=True, related_name='held_item')
|
||||
|
||||
|
@ -1299,7 +1327,11 @@ class MoveLearnMethod(HasName):
|
|||
pass
|
||||
|
||||
#PokemonMoveMethodName
|
||||
class MoveLearnMethodName(IsName, HasMoveLearnMethod, HasDescription):
|
||||
class MoveLearnMethodName(IsName, HasMoveLearnMethod):
|
||||
pass
|
||||
|
||||
|
||||
class MoveLearnMethodDescription(IsDescription, HasMoveLearnMethod):
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -231,11 +231,11 @@ class PokemonFormSummarySerializer(serializers.HyperlinkedModelSerializer):
|
|||
|
||||
class LanguageNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
local_language_url = serializers.HyperlinkedRelatedField(read_only='True', source="local_language_id", view_name='language-detail')
|
||||
language = LanguageSummarySerializer(source="local_language")
|
||||
|
||||
class Meta:
|
||||
model = LanguageName
|
||||
fields = ('name', 'local_language_url')
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class LanguageDetailSerializer(serializers.ModelSerializer):
|
||||
|
@ -244,7 +244,7 @@ class LanguageDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
class Meta:
|
||||
model = Language
|
||||
fields = ('name', 'official', 'iso639', 'iso3166', 'id', 'names')
|
||||
fields = ('id', 'name', 'official', 'iso639', 'iso3166', 'names')
|
||||
|
||||
|
||||
|
||||
|
@ -393,12 +393,12 @@ class LocationDetailSerializer(serializers.ModelSerializer):
|
|||
# ABILITY SERIALIZERS #
|
||||
#########################
|
||||
|
||||
class AbilityDescriptionSerializer(serializers.ModelSerializer):
|
||||
class AbilityEffectTextSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = AbilityDescription
|
||||
model = AbilityEffectText
|
||||
fields = ('effect', 'short_effect', 'language')
|
||||
|
||||
|
||||
|
@ -424,7 +424,7 @@ class AbilityNameSerializer(serializers.ModelSerializer):
|
|||
|
||||
class AbilityDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
descriptions = AbilityDescriptionSerializer(many=True, read_only=True, source="abilitydescription")
|
||||
effect_text_entries = AbilityEffectTextSerializer(many=True, read_only=True, source="abilityeffecttext")
|
||||
flavor_text_entries = AbilityFlavorTextSerializer(many=True, read_only=True, source="abilityflavortext")
|
||||
names = AbilityNameSerializer(many=True, read_only=True, source="abilityname")
|
||||
generation = GenerationSummarySerializer()
|
||||
|
@ -437,7 +437,7 @@ class AbilityDetailSerializer(serializers.ModelSerializer):
|
|||
'is_main_series',
|
||||
'generation',
|
||||
'names',
|
||||
'descriptions',
|
||||
'effect_text_entries',
|
||||
'flavor_text_entries'
|
||||
)
|
||||
|
||||
|
@ -447,12 +447,23 @@ class AbilityDetailSerializer(serializers.ModelSerializer):
|
|||
# STAT SERIALIZERS #
|
||||
######################
|
||||
|
||||
class StatDetailSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class StatNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = StatName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class StatDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = StatNameSerializer(many=True, read_only=True, source="statname")
|
||||
move_damage_class = MoveDamageClassSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = Stat
|
||||
fields = ('id', 'name', 'game_index', 'is_battle_only', 'move_damage_class', 'names')
|
||||
|
||||
|
||||
|
||||
|
@ -506,46 +517,33 @@ class ItemCategoryDetailSerializer(serializers.ModelSerializer):
|
|||
# ITEM ATTRIBUTE SERIALIZERS #
|
||||
################################
|
||||
|
||||
class ItemAttributeNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = ItemAttributeName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class ItemAttributeDescriptionSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = ItemAttributeDescription
|
||||
fields = ('name', 'description', 'language')
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class ItemAttributeDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = serializers.SerializerMethodField('get_attribute_names')
|
||||
descriptions = serializers.SerializerMethodField('get_attribute_descriptions')
|
||||
names = ItemAttributeNameSerializer(many=True, read_only=True, source="itemattributename")
|
||||
descriptions = ItemAttributeDescriptionSerializer(many=True, read_only=True, source="itemattributedescription")
|
||||
|
||||
class Meta:
|
||||
model = ItemAttribute
|
||||
fields = ('id', 'name', 'names', 'descriptions')
|
||||
|
||||
def get_attribute_names(self, obj):
|
||||
|
||||
item_attribute = ItemAttributeDescription.objects.filter(item_attribute_id=obj)
|
||||
serializer = ItemAttributeDescriptionSerializer(item_attribute, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for attribute in data:
|
||||
del attribute['description']
|
||||
|
||||
return data
|
||||
|
||||
def get_attribute_descriptions(self, obj):
|
||||
|
||||
item_attribute = ItemAttributeDescription.objects.filter(item_attribute_id=obj)
|
||||
serializer = ItemAttributeDescriptionSerializer(item_attribute, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for attribute in data:
|
||||
del attribute['name']
|
||||
|
||||
return data
|
||||
|
||||
|
||||
class ItemAttributeMapSerializer(serializers.ModelSerializer):
|
||||
|
||||
|
@ -596,12 +594,12 @@ class ItemFlavorTextSerializer(serializers.ModelSerializer):
|
|||
fields = ('text', 'version_group', 'language')
|
||||
|
||||
|
||||
class ItemDescriptionSerializer(serializers.ModelSerializer):
|
||||
class ItemEffectTextSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = ItemDescription
|
||||
model = ItemEffectText
|
||||
fields = ('effect', 'short_effect', 'language')
|
||||
|
||||
|
||||
|
@ -617,7 +615,7 @@ class ItemNameSerializer(serializers.ModelSerializer):
|
|||
class ItemDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = ItemNameSerializer(many=True, read_only=True, source="itemname")
|
||||
descriptions = ItemDescriptionSerializer(many=True, read_only=True, source="itemdescription")
|
||||
effect_text_entries = ItemEffectTextSerializer(many=True, read_only=True, source="itemeffecttext")
|
||||
flavor_text_entries = ItemFlavorTextSerializer(many=True, read_only=True, source="itemflavortext")
|
||||
category = ItemCategorySummarySerializer(source="item_category")
|
||||
attributes = serializers.SerializerMethodField("get_item_attributes")
|
||||
|
@ -634,8 +632,8 @@ class ItemDetailSerializer(serializers.ModelSerializer):
|
|||
'category',
|
||||
'attributes',
|
||||
'names',
|
||||
'descriptions',
|
||||
'flavor_text_entries'
|
||||
'effect_text_entries',
|
||||
'flavor_text_entries',
|
||||
)
|
||||
|
||||
def get_item_attributes(self, obj):
|
||||
|
@ -662,20 +660,24 @@ class ItemDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
class NatureNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
name = LanguageSummarySerializer()
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = NatureName
|
||||
fields = ('description', 'language')
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class NatureDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
# NEED FLAVORS
|
||||
|
||||
names = NatureNameSerializer(many=True, read_only=True, source="naturename")
|
||||
decreased_stat = StatSummarySerializer()
|
||||
increased_stat = StatSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = Nature
|
||||
fields = ('id', 'name', 'names')
|
||||
fields = ('id', 'name', 'names', 'decreased_stat', 'increased_stat')
|
||||
|
||||
|
||||
|
||||
|
@ -847,67 +849,78 @@ class TypeDetailSerializer(serializers.ModelSerializer):
|
|||
# MOVE DAMAGE CLASS SERIALIZERS #
|
||||
###################################
|
||||
|
||||
class MoveDamageClassNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveDamageClassName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class MoveDamageClassDescriptionSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveDamageClassDescription
|
||||
fields = ('name', 'description', 'language')
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class MoveDamageClassDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = serializers.SerializerMethodField('get_move_damage_class_names')
|
||||
descriptions = serializers.SerializerMethodField('get_move_damage_class_descriptions')
|
||||
names = MoveDamageClassNameSerializer(many=True, read_only=True, source="movedamageclassname")
|
||||
descriptions = MoveDamageClassDescriptionSerializer(many=True, read_only=True, source="movedamageclassdescription")
|
||||
|
||||
class Meta:
|
||||
model = MoveDamageClass
|
||||
fields = ('id', 'name', 'names', 'descriptions')
|
||||
|
||||
def get_move_damage_class_names(self, obj):
|
||||
|
||||
move_methods = MoveDamageClassDescription.objects.filter(move_damage_class_id=obj)
|
||||
serializer = MoveDamageClassDescriptionSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['description']
|
||||
|
||||
return data
|
||||
|
||||
def get_move_damage_class_descriptions(self, obj):
|
||||
|
||||
move_methods = MoveDamageClassDescription.objects.filter(move_damage_class_id=obj)
|
||||
serializer = MoveDamageClassDescriptionSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['name']
|
||||
|
||||
return data
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# MOVE META SERIALIZERS #
|
||||
###########################
|
||||
|
||||
class MoveMetaAilmentNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveMetaAilmentName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = MoveMetaAilmentNameSerializer(many=True, read_only=True, source="movemetaailmentname")
|
||||
|
||||
class Meta:
|
||||
model = MoveMetaAilment
|
||||
fields = ('id', 'name', 'names')
|
||||
|
||||
|
||||
class MoveMetaCategoryDescriptionSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveMetaCategoryDescription
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
descriptions = MoveMetaCategoryDescriptionSerializer(many=True, read_only=True, source="movemetacategorydescription")
|
||||
|
||||
class Meta:
|
||||
model = MoveMetaCategory
|
||||
fields = ('id', 'name', 'descriptions')
|
||||
|
||||
|
||||
class MoveMetaSerializer(serializers.ModelSerializer):
|
||||
|
||||
ailment = MoveMetaAilmentSummarySerializer(source="move_meta_category")
|
||||
ailment = MoveMetaAilmentSummarySerializer(source="move_meta_ailment")
|
||||
category = MoveMetaCategorySummarySerializer(source="move_meta_category")
|
||||
|
||||
class Meta:
|
||||
|
@ -933,46 +946,33 @@ class MoveMetaSerializer(serializers.ModelSerializer):
|
|||
# MOVE TARGET SERIALIZERS #
|
||||
#############################
|
||||
|
||||
class MoveTargetNameSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveTargetName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class MoveTargetDescriptionSerializer(serializers.ModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveTargetDescription
|
||||
fields = ('name', 'description', 'language')
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class MoveTargetDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = serializers.SerializerMethodField('get_move_target_names')
|
||||
descriptions = serializers.SerializerMethodField('get_move_target_descriptions')
|
||||
names = MoveTargetNameSerializer(many=True, read_only=True, source="movetargetname")
|
||||
descriptions = MoveTargetDescriptionSerializer(many=True, read_only=True, source="movetargetdescription")
|
||||
|
||||
class Meta:
|
||||
model = MoveTarget
|
||||
fields = ('id', 'name', 'names', 'descriptions')
|
||||
|
||||
def get_move_target_names(self, obj):
|
||||
|
||||
move_methods = MoveTargetDescription.objects.filter(move_target_id=obj)
|
||||
serializer = MoveTargetDescriptionSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['description']
|
||||
|
||||
return data
|
||||
|
||||
def get_move_target_descriptions(self, obj):
|
||||
|
||||
move_methods = MoveTargetDescription.objects.filter(move_target_id=obj)
|
||||
serializer = MoveTargetDescriptionSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['name']
|
||||
|
||||
return data
|
||||
|
||||
|
||||
|
||||
######################
|
||||
|
@ -992,7 +992,7 @@ class MoveDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
generation = GenerationSummarySerializer()
|
||||
type = TypeSummarySerializer()
|
||||
move_target = MoveTargetSummarySerializer()
|
||||
target = MoveTargetSummarySerializer(source="move_target")
|
||||
damage_class = MoveDamageClassSummarySerializer(source="move_damage_class")
|
||||
meta = MoveMetaSerializer(read_only=True, source="movemeta")
|
||||
names = MoveNameSerializer(many=True, read_only=True, source="movename")
|
||||
|
@ -1008,7 +1008,7 @@ class MoveDetailSerializer(serializers.ModelSerializer):
|
|||
'effect_chance',
|
||||
'generation',
|
||||
'meta',
|
||||
'move_target',
|
||||
'target',
|
||||
'names',
|
||||
'power',
|
||||
'pp',
|
||||
|
@ -1107,32 +1107,33 @@ class PokemonHabitatDetailSerializer(serializers.ModelSerializer):
|
|||
# POKEMON MOVE SERIALIZERS #
|
||||
##############################
|
||||
|
||||
class MoveLearnMethodNameSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveLearnMethodName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class MoveLearnMethodDescriptionSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = MoveLearnMethodDescription
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class MoveLearnMethodDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
names = MoveLearnMethodNameSerializer(many=True, read_only=True, source="movelearnmethodname")
|
||||
descriptions = MoveLearnMethodDescriptionSerializer(many=True, read_only=True, source="movelearnmethoddescription")
|
||||
|
||||
class Meta:
|
||||
model = MoveLearnMethod
|
||||
fields = ('id', 'name', 'names', 'descriptions')
|
||||
|
||||
def get_move_method_names(self, obj):
|
||||
|
||||
move_methods = MoveLearnMethodName.objects.filter(pokemon_move_method_id=obj)
|
||||
serializer = MoveLearnMethodNameSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['description']
|
||||
|
||||
return data
|
||||
|
||||
def get_move_method_descriptions(self, obj):
|
||||
|
||||
move_methods = MoveLearnMethodName.objects.filter(pokemon_move_method_id=obj)
|
||||
serializer = MoveLearnMethodNameSerializer(move_methods, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['name']
|
||||
|
||||
return data
|
||||
|
||||
|
||||
class PokemonMoveSerializer(serializers.ModelSerializer):
|
||||
|
@ -1298,8 +1299,6 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
for move in serializer.data:
|
||||
|
||||
print move
|
||||
|
||||
version_detail = OrderedDict()
|
||||
|
||||
version_detail['level_learned_at'] = move['level']
|
||||
|
@ -1341,8 +1340,6 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
for item in serializer.data:
|
||||
|
||||
print item
|
||||
|
||||
version_detail = OrderedDict()
|
||||
|
||||
version_detail['rarity'] = item['rarity']
|
||||
|
@ -1512,6 +1509,7 @@ class PokemonEvolutionSerializer(serializers.ModelSerializer):
|
|||
party_species = PokemonSpeciesSummarySerializer()
|
||||
party_type = TypeSummarySerializer()
|
||||
trade_species = PokemonSpeciesSummarySerializer()
|
||||
location = LocationSummarySerializer()
|
||||
trigger = EvolutionTriggerSummarySerializer(source="evolution_trigger")
|
||||
|
||||
class Meta:
|
||||
|
@ -1523,7 +1521,7 @@ class PokemonEvolutionSerializer(serializers.ModelSerializer):
|
|||
'held_item',
|
||||
'known_move',
|
||||
'known_move_type',
|
||||
'location_id',
|
||||
'location',
|
||||
'min_level',
|
||||
'min_happiness',
|
||||
'min_beauty',
|
||||
|
@ -1576,8 +1574,10 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
entry = OrderedDict()
|
||||
|
||||
evolution_object = PokemonEvolution.objects.filter(evolved_species=species['id'])
|
||||
evolution_data = PokemonEvolutionSerializer(evolution_object, many=True, context=self.context).data
|
||||
evolution_object = PokemonEvolution.objects.get(evolved_species=species['id'])
|
||||
evolution_data = PokemonEvolutionSerializer(evolution_object, context=self.context).data
|
||||
|
||||
print evolution_data
|
||||
|
||||
current_evolutions.append(entry)
|
||||
|
||||
|
@ -1610,13 +1610,22 @@ class PokemonDexNumberSerializer(serializers.ModelSerializer):
|
|||
# POKEDEX SERIALIZERS #
|
||||
#########################
|
||||
|
||||
class PokedexNameSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = PokedexName
|
||||
fields = ('name', 'language')
|
||||
|
||||
|
||||
class PokedexDescriptionSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
||||
language = LanguageSummarySerializer()
|
||||
|
||||
class Meta:
|
||||
model = PokedexDescription
|
||||
fields = ('name', 'description', 'language')
|
||||
fields = ('description', 'language')
|
||||
|
||||
|
||||
class PokedexDetailSerializer(serializers.ModelSerializer):
|
||||
|
@ -1627,35 +1636,13 @@ class PokedexDetailSerializer(serializers.ModelSerializer):
|
|||
"""
|
||||
|
||||
region = RegionSummarySerializer()
|
||||
names = serializers.SerializerMethodField('get_pokedex_names')
|
||||
descriptions = serializers.SerializerMethodField('get_pokedex_descriptions')
|
||||
names = PokedexNameSerializer(many=True, read_only=True, source="pokedexname")
|
||||
descriptions = PokedexDescriptionSerializer(many=True, read_only=True, source="pokedexdescription")
|
||||
# pokemon_entries = serializers.SerializerMethodField('get_pokedex_entries')
|
||||
|
||||
class Meta:
|
||||
model = Pokedex
|
||||
fields = ('id', 'name', 'is_main_series', 'region', 'names', 'descriptions',)# 'pokemon_entries')
|
||||
|
||||
def get_pokedex_names(self, obj):
|
||||
|
||||
results = PokedexDescription.objects.filter(pokedex_id=obj)
|
||||
serializer = PokedexDescriptionSerializer(results, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['description']
|
||||
|
||||
return data
|
||||
|
||||
def get_pokedex_descriptions(self, obj):
|
||||
|
||||
results = PokedexDescription.objects.filter(pokedex_id=obj)
|
||||
serializer = PokedexDescriptionSerializer(results, many=True, context=self.context)
|
||||
data = serializer.data
|
||||
|
||||
for name in data:
|
||||
del name['name']
|
||||
|
||||
return data
|
||||
fields = ('id', 'name', 'is_main_series', 'region', 'names', 'descriptions',)
|
||||
|
||||
def get_pokedex_entries(self, obj):
|
||||
|
||||
|
|
1589
pokemon_v2/tests.py
1589
pokemon_v2/tests.py
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue