2015-04-21 03:31:59 +00:00
|
|
|
# To build out the data you'll need to jump into the Django shell
|
|
|
|
#
|
|
|
|
# $ python manage.py shell
|
|
|
|
#
|
|
|
|
# and run the build script with
|
|
|
|
#
|
|
|
|
# $ execfile('data/v2/build.py')
|
|
|
|
#
|
|
|
|
# Each time the build script is run it will iterate over each table in the database,
|
|
|
|
# wipe it and rewrite each row using the data found in data/v2/csv.
|
|
|
|
# If you don't need all of the data just go into data/v2/build.py and
|
|
|
|
# comment out everything but what you need to build the tables you're looking for.
|
|
|
|
# This might be useful because some of the csv files are massive
|
|
|
|
# (pokemon_moves expecially) and it can take about 30 minutes to build everything.
|
|
|
|
|
2015-04-02 12:21:39 +00:00
|
|
|
import csv
|
|
|
|
import os
|
2015-04-21 03:31:59 +00:00
|
|
|
from django.db import migrations, connection
|
2015-04-02 12:21:39 +00:00
|
|
|
from pokemon_v2.models import *
|
|
|
|
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
data_location = 'data/v2/csv/'
|
2015-04-21 03:31:59 +00:00
|
|
|
db_cursor = connection.cursor()
|
|
|
|
db_vendor = connection.vendor
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
def loadData(fileName):
|
|
|
|
return csv.reader(open(data_location + fileName, 'rb'), delimiter=',')
|
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-04-06 04:27:59 +00:00
|
|
|
def clearTable(model):
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
table_name = model._meta.db_table
|
2015-04-06 04:27:59 +00:00
|
|
|
model.objects.all().delete()
|
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
print 'building ' + table_name
|
|
|
|
|
|
|
|
# Reset DB auto increments to start at 1
|
|
|
|
if db_vendor == 'sqlite':
|
|
|
|
db_cursor.execute("DELETE FROM sqlite_sequence WHERE name = " + "'" + table_name + "'" )
|
|
|
|
else:
|
|
|
|
db_cursor.execute("SELECT setval(pg_get_serial_sequence(" + "'" + table_name + "'" + ",'id'), 1, false);")
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
##############
|
|
|
|
# LANGUAGE #
|
|
|
|
##############
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Language)
|
|
|
|
data = loadData('languages.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
language = Language (
|
|
|
|
id = int(info[0]),
|
|
|
|
iso639 = info[1],
|
|
|
|
iso3166 = info[2],
|
|
|
|
name = info[3],
|
|
|
|
official = bool(int(info[4])),
|
|
|
|
order = info[5],
|
|
|
|
)
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
language.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(LanguageName)
|
|
|
|
data = loadData('language_names.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
languageName = LanguageName (
|
|
|
|
language = Language.objects.get(pk = int(info[0])),
|
|
|
|
local_language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
languageName.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
############
|
|
|
|
# REGION #
|
|
|
|
############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Region)
|
|
|
|
data = loadData('regions.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Region (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(RegionName)
|
|
|
|
data = loadData('region_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = RegionName (
|
|
|
|
region = Region.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
################
|
|
|
|
# GENERATION #
|
|
|
|
################
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Generation)
|
|
|
|
data = loadData('generations.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Generation (
|
|
|
|
id = int(info[0]),
|
|
|
|
region = Region.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(GenerationName)
|
|
|
|
data = loadData('generation_names.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = GenerationName (
|
|
|
|
generation = Generation.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#############
|
|
|
|
# VERSION #
|
|
|
|
#############
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(VersionGroup)
|
|
|
|
data = loadData('version_groups.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
versionGroup = VersionGroup (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
generation = Generation.objects.get(pk = int(info[2])),
|
|
|
|
order = int(info[3])
|
|
|
|
)
|
|
|
|
versionGroup.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(VersionGroupRegion)
|
|
|
|
data = loadData('version_group_regions.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
versionGroupRegion = VersionGroupRegion (
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[0])),
|
|
|
|
region = Region.objects.get(pk = int(info[1])),
|
|
|
|
)
|
|
|
|
versionGroupRegion.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Version)
|
|
|
|
data = loadData('versions.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
version = Version (
|
|
|
|
id = int(info[0]),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
version.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(VersionName)
|
|
|
|
data = loadData('version_names.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
versionName = VersionName (
|
|
|
|
version = Version.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
versionName.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
##################
|
|
|
|
# DAMAGE CLASS #
|
|
|
|
##################
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveDamageClass)
|
|
|
|
data = loadData('move_damage_classes.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveDamageClass (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveDamageClassName)
|
|
|
|
clearTable(MoveDamageClassDescription)
|
|
|
|
data = loadData('move_damage_class_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model_name = MoveDamageClassName (
|
|
|
|
move_damage_class = MoveDamageClass.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model_name.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###########
|
|
|
|
# STATS #
|
|
|
|
###########
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Stat)
|
|
|
|
data = loadData('stats.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
stat = Stat (
|
|
|
|
id = int(info[0]),
|
|
|
|
move_damage_class = MoveDamageClass.objects.get(pk = int(info[1])) if info[1] != '' else None,
|
|
|
|
name = info[2],
|
|
|
|
is_battle_only = bool(int(info[3])),
|
|
|
|
game_index = int(info[4]) if info[4] else 0,
|
|
|
|
)
|
|
|
|
stat.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(StatName)
|
|
|
|
data = loadData('stat_names.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
statName = StatName (
|
|
|
|
stat = Stat.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
statName.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokeathlonStat)
|
|
|
|
data = loadData('pokeathlon_stats.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
stat = PokeathlonStat (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
)
|
|
|
|
stat.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokeathlonStatName)
|
|
|
|
data = loadData('pokeathlon_stat_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
statName = PokeathlonStatName (
|
|
|
|
pokeathlon_stat = PokeathlonStat.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
statName.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
# ###############
|
|
|
|
# # ABILITIES #
|
|
|
|
# ###############
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Ability)
|
|
|
|
data = loadData('abilities.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
ability = Ability (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
generation = Generation.objects.get(pk = int(info[2])),
|
|
|
|
is_main_series = bool(int(info[3]))
|
|
|
|
)
|
|
|
|
ability.save()
|
2015-04-03 12:03:02 +00:00
|
|
|
|
2015-04-02 12:21:39 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(AbilityName)
|
|
|
|
data = loadData('ability_names.csv')
|
2015-04-02 12:21:39 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-02 12:21:39 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
abilityName = AbilityName (
|
|
|
|
ability = Ability.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
abilityName.save()
|
2015-04-02 12:21:39 +00:00
|
|
|
|
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
clearTable(AbilityChange)
|
|
|
|
data = loadData('ability_changelog.csv')
|
|
|
|
|
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
|
|
|
|
|
|
|
abilityName = AbilityChange (
|
|
|
|
id = int(info[0]),
|
|
|
|
ability = Ability.objects.get(pk = int(info[1])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[2]))
|
|
|
|
)
|
|
|
|
abilityName.save()
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(AbilityEffectText)
|
|
|
|
data = loadData('ability_prose.csv')
|
2015-04-02 12:21:39 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
abilityDesc = AbilityEffectText (
|
|
|
|
ability = Ability.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
short_effect = info[2],
|
|
|
|
effect = info[3]
|
|
|
|
)
|
|
|
|
abilityDesc.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
clearTable(AbilityChangeEffectText)
|
|
|
|
data = loadData('ability_changelog_prose.csv')
|
|
|
|
|
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
|
|
|
|
|
|
|
abilityChangeEffectText = AbilityChangeEffectText (
|
|
|
|
ability_change = AbilityChange.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
effect = info[2]
|
|
|
|
)
|
|
|
|
abilityChangeEffectText.save()
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(AbilityFlavorText)
|
|
|
|
data = loadData('ability_flavor_text.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
abilityFlavorText = AbilityFlavorText (
|
|
|
|
ability = Ability.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
language = Language.objects.get(pk = int(info[2])),
|
|
|
|
flavor_text = info[3]
|
|
|
|
)
|
|
|
|
abilityFlavorText.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
####################
|
|
|
|
# CHARACTERISTIC #
|
|
|
|
####################
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Characteristic)
|
|
|
|
data = loadData('characteristics.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Characteristic (
|
|
|
|
id = int(info[0]),
|
|
|
|
stat = Stat.objects.get(pk = int(info[1])),
|
|
|
|
gene_mod_5 = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(CharacteristicDescription)
|
|
|
|
data = loadData('characteristic_text.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = CharacteristicDescription (
|
|
|
|
characteristic = Characteristic.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###############
|
|
|
|
# EGG GROUP #
|
|
|
|
###############
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EggGroup)
|
|
|
|
data = loadData('egg_groups.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EggGroup (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EggGroupName)
|
|
|
|
data = loadData('egg_group_prose.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EggGroupName (
|
|
|
|
egg_group = EggGroup.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#################
|
|
|
|
# GROWTH RATE #
|
|
|
|
#################
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(GrowthRate)
|
|
|
|
data = loadData('growth_rates.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = GrowthRate (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
formula = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(GrowthRateDescription)
|
|
|
|
data = loadData('growth_rate_prose.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = GrowthRateDescription (
|
|
|
|
growth_rate = GrowthRate.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemPocket)
|
|
|
|
data = loadData('item_pockets.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemPocket (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemPocketName)
|
|
|
|
data = loadData('item_pocket_names.csv')
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemPocketName (
|
|
|
|
item_pocket = ItemPocket.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemFlingEffect)
|
|
|
|
data = loadData('item_fling_effects.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemFlingEffect (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemFlingEffectDescription)
|
|
|
|
data = loadData('item_fling_effect_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemFlingEffectDescription (
|
|
|
|
item_fling_effect = ItemFlingEffect.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemCategory)
|
|
|
|
data = loadData('item_categories.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemCategory (
|
|
|
|
id = int(info[0]),
|
|
|
|
item_pocket = ItemPocket.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemCategoryName)
|
|
|
|
data = loadData('item_category_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemCategoryName (
|
|
|
|
item_category = ItemCategory.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Item)
|
|
|
|
data = loadData('items.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Item (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
item_category = ItemCategory.objects.get(pk = int(info[2])),
|
|
|
|
cost = int(info[3]),
|
|
|
|
fling_power = int(info[4]) if info[4] != '' else None,
|
|
|
|
item_fling_effect = ItemFlingEffect.objects.get(pk = int(info[5])) if info[5] != '' else None
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-07 12:14:31 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemName)
|
|
|
|
data = loadData('item_names.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemName (
|
|
|
|
item = Item.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-20 02:24:14 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemEffectText)
|
|
|
|
data = loadData('item_prose.csv')
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemEffectText (
|
|
|
|
item = Item.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
short_effect = info[2],
|
|
|
|
effect = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-20 02:24:14 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemGameIndex)
|
|
|
|
data = loadData('item_game_indices.csv')
|
2015-04-20 02:24:14 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemGameIndex (
|
|
|
|
item = Item.objects.get(pk = int(info[0])),
|
|
|
|
generation = Generation.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemFlavorText)
|
|
|
|
data = loadData('item_flavor_text.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemFlavorText (
|
|
|
|
item = Item.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
language = Language.objects.get(pk = int(info[2])),
|
|
|
|
flavor_text = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemAttribute)
|
|
|
|
data = loadData('item_flags.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemAttribute (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemAttributeName)
|
|
|
|
clearTable(ItemAttributeDescription)
|
|
|
|
data = loadData('item_flag_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model_description = ItemAttributeDescription (
|
|
|
|
item_attribute = ItemAttribute.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[3]
|
|
|
|
)
|
|
|
|
model_description.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ItemAttributeMap)
|
|
|
|
data = loadData('item_flag_map.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ItemAttributeMap (
|
|
|
|
item = Item.objects.get(pk = int(info[0])),
|
|
|
|
item_attribute = ItemAttribute.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###########
|
|
|
|
# TYPES #
|
|
|
|
###########
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Type)
|
|
|
|
data = loadData('types.csv')
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-07 12:14:31 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
type = Type (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
generation = Generation.objects.get(pk = int(info[2])),
|
|
|
|
move_damage_class = MoveDamageClass.objects.get(pk = int(info[3])) if info[3] != '' else None
|
|
|
|
)
|
|
|
|
type.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(TypeName)
|
|
|
|
data = loadData('type_names.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
typeName = TypeName (
|
|
|
|
type = Type.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
typeName.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(TypeGameIndex)
|
|
|
|
data = loadData('type_game_indices.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
typeGameIndex = TypeGameIndex (
|
|
|
|
type = Type.objects.get(pk = int(info[0])),
|
|
|
|
generation = Generation.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
typeGameIndex.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(TypeEfficacy)
|
|
|
|
data = loadData('type_efficacy.csv')
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-06 04:27:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
typeEfficacy = TypeEfficacy (
|
|
|
|
damage_type = Type.objects.get(pk = int(info[0])),
|
|
|
|
target_type = Type.objects.get(pk = int(info[1])),
|
|
|
|
damage_factor = int(info[2])
|
|
|
|
)
|
|
|
|
typeEfficacy.save()
|
2015-04-06 04:27:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###########
|
|
|
|
# MOVES #
|
|
|
|
###########
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveEffect)
|
|
|
|
data = loadData('move_effects.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveEffect (
|
|
|
|
id = int(info[0])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveEffectEffectText)
|
|
|
|
data = loadData('move_effect_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveEffectEffectText (
|
2015-11-08 21:26:02 +00:00
|
|
|
move_effect = MoveEffect.objects.get(pk = int(info[0])),
|
2015-10-29 17:45:58 +00:00
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
short_effect = info[2],
|
|
|
|
effect = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveEffectChange)
|
|
|
|
data = loadData('move_effect_changelog.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveEffectChange (
|
|
|
|
id = int(info[0]),
|
|
|
|
move_effect = MoveEffect.objects.get(pk = int(info[1])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[2]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveEffectChangeEffectText)
|
|
|
|
data = loadData('move_effect_changelog_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveEffectChangeEffectText (
|
|
|
|
move_effect_change = MoveEffectChange.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
effect = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveLearnMethod)
|
|
|
|
data = loadData('pokemon_move_methods.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveLearnMethod (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-09-27 04:20:19 +00:00
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
clearTable(VersionGroupMoveLearnMethod)
|
|
|
|
data = loadData('version_group_pokemon_move_methods.csv')
|
|
|
|
|
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
|
|
|
|
|
|
|
versionGroupMoveLearnMethod = VersionGroupMoveLearnMethod (
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[0])),
|
|
|
|
move_learn_method = MoveLearnMethod.objects.get(pk = int(info[1])),
|
|
|
|
)
|
|
|
|
versionGroupMoveLearnMethod.save()
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveLearnMethodName)
|
|
|
|
clearTable(MoveLearnMethodDescription)
|
|
|
|
data = loadData('pokemon_move_method_prose.csv')
|
2015-09-27 04:20:19 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-09-27 04:20:19 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model_description = MoveLearnMethodDescription (
|
|
|
|
move_learn_method = MoveLearnMethod.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[3]
|
|
|
|
)
|
|
|
|
model_description.save()
|
2015-09-27 04:20:19 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveTarget)
|
|
|
|
data = loadData('move_targets.csv')
|
2015-09-27 04:20:19 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-09-27 04:20:19 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveTarget (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveTargetName)
|
|
|
|
clearTable(MoveTargetDescription)
|
|
|
|
data = loadData('move_target_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model_description = MoveTargetDescription (
|
|
|
|
move_target = MoveTarget.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[3]
|
|
|
|
)
|
|
|
|
model_description.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Move)
|
|
|
|
data = loadData('moves.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Move (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
generation = Generation.objects.get(pk = int(info[2])),
|
|
|
|
type = Type.objects.get(pk = int(info[3])),
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
power = int(info[4]) if info[4] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
pp = int(info[5]) if info[5] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
accuracy = int(info[6]) if info[6] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
priority = int(info[7]) if info[7] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
move_target = MoveTarget.objects.get(pk = int(info[8])),
|
|
|
|
move_damage_class = MoveDamageClass.objects.get(pk = int(info[9])),
|
|
|
|
move_effect = MoveEffect.objects.get(pk = int(info[10])),
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
move_effect_chance = int(info[11]) if info[11] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
contest_type_id = int(info[12]) if info[12] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
contest_effect_id = int(info[13]) if info[13] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
super_contest_effect_id = int(info[14]) if info[14] != '' else None
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveName)
|
|
|
|
data = loadData('move_names.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveName (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveFlavorText)
|
|
|
|
data = loadData('move_flavor_text.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveFlavorText (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
language = Language.objects.get(pk = int(info[2])),
|
|
|
|
flavor_text = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveChange)
|
|
|
|
data = loadData('move_changelog.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveChange (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
type = Type.objects.get(pk = int(info[2])) if info[2] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
power = int(info[3]) if info[3] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
pp = int(info[4]) if info[4] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
accuracy = int(info[5]) if info[5] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
move_effect = MoveEffect.objects.get(pk = int(info[6])) if info[6] != '' else None,
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
move_effect_chance = int(info[7]) if info[7] != '' else None
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveBattleStyle)
|
|
|
|
data = loadData('move_battle_styles.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveBattleStyle (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveBattleStyleName)
|
|
|
|
data = loadData('move_battle_style_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveBattleStyleName (
|
|
|
|
move_battle_style = MoveBattleStyle.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveAttribute)
|
|
|
|
data = loadData('move_flags.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveAttribute (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveAttributeMap)
|
|
|
|
data = loadData('move_flag_map.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveAttributeMap (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
move_attribute = MoveAttribute.objects.get(pk = int(info[1])),
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveAttributeName)
|
|
|
|
clearTable(MoveAttributeDescription)
|
|
|
|
data = loadData('move_flag_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
description_model = MoveAttributeDescription (
|
|
|
|
move_attribute = MoveAttribute.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[3]
|
|
|
|
)
|
|
|
|
description_model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMetaAilment)
|
|
|
|
data = loadData('move_meta_ailments.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMetaAilment (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMetaAilmentName)
|
|
|
|
data = loadData('move_meta_ailment_names.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMetaAilmentName (
|
|
|
|
move_meta_ailment = MoveMetaAilment.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMetaCategory)
|
|
|
|
data = loadData('move_meta_categories.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMetaCategory (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMetaCategoryDescription)
|
|
|
|
data = loadData('move_meta_category_prose.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMetaCategoryDescription (
|
|
|
|
move_meta_category = MoveMetaCategory.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMeta)
|
|
|
|
data = loadData('move_meta.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMeta (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
move_meta_category = MoveMetaCategory.objects.get(pk = int(info[1])),
|
|
|
|
move_meta_ailment = MoveMetaAilment.objects.get(pk = int(info[2])),
|
|
|
|
min_hits = int(info[3]) if info[3] != '' else None,
|
|
|
|
max_hits = int(info[4]) if info[4] != '' else None,
|
|
|
|
min_turns = int(info[5]) if info[5] != '' else None,
|
|
|
|
max_turns = int(info[6]) if info[6] != '' else None,
|
|
|
|
drain = int(info[7]) if info[7] != '' else None,
|
|
|
|
healing = int(info[8]) if info[8] != '' else None,
|
|
|
|
crit_rate = int(info[9]) if info[9] != '' else None,
|
|
|
|
ailment_chance = int(info[10]) if info[10] != '' else None,
|
|
|
|
flinch_chance = int(info[11]) if info[11] != '' else None,
|
|
|
|
stat_chance = int(info[12]) if info[12] != '' else None
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(MoveMetaStatChange)
|
|
|
|
data = loadData('move_meta_stat_changes.csv')
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = MoveMetaStatChange (
|
|
|
|
move = Move.objects.get(pk = int(info[0])),
|
|
|
|
stat = Stat.objects.get(pk = int(info[1])),
|
|
|
|
change = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-09 04:45:23 +00:00
|
|
|
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#############
|
|
|
|
# CONTEST #
|
|
|
|
#############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ContestType)
|
|
|
|
data = loadData('contest_types.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ContestType (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ContestTypeName)
|
|
|
|
data = loadData('contest_type_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ContestTypeName (
|
|
|
|
contest_type = ContestType.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
flavor = info[3],
|
|
|
|
color = info[4]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ContestEffect)
|
|
|
|
data = loadData('contest_effects.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ContestEffect (
|
|
|
|
id = int(info[0]),
|
|
|
|
appeal = int(info[1]),
|
|
|
|
jam = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ContestEffectEffectText)
|
|
|
|
data = loadData('contest_effect_prose.csv')
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ContestEffectEffectText (
|
|
|
|
contest_effect = ContestEffect.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
effect = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(ContestCombo)
|
|
|
|
data = loadData('contest_combos.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = ContestCombo (
|
|
|
|
first_move = Move.objects.get(pk = int(info[0])),
|
|
|
|
second_move = Move.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(SuperContestEffect)
|
|
|
|
data = loadData('super_contest_effects.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = SuperContestEffect (
|
|
|
|
id = int(info[0]),
|
|
|
|
appeal = int(info[1])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(SuperContestEffectFlavorText)
|
|
|
|
data = loadData('super_contest_effect_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = SuperContestEffectFlavorText (
|
|
|
|
super_contest_effect = SuperContestEffect.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
flavor_text = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(SuperContestCombo)
|
|
|
|
data = loadData('super_contest_combos.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = SuperContestCombo (
|
|
|
|
first_move = Move.objects.get(pk = int(info[0])),
|
|
|
|
second_move = Move.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#############
|
|
|
|
# BERRIES #
|
|
|
|
#############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(BerryFirmness)
|
|
|
|
data = loadData('berry_firmness.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = BerryFirmness (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(BerryFirmnessName)
|
|
|
|
data = loadData('berry_firmness_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = BerryFirmnessName (
|
|
|
|
berry_firmness = BerryFirmness.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Berry)
|
|
|
|
data = loadData('berries.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
item = Item.objects.get(pk = int(info[1]))
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Berry (
|
|
|
|
id = int(info[0]),
|
|
|
|
item = item,
|
|
|
|
name = item.name[:item.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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(BerryFlavor)
|
|
|
|
data = loadData('berry_flavors.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
############
|
|
|
|
# NATURE #
|
|
|
|
############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Nature)
|
|
|
|
data = loadData('natures.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#Berry/Nature associations
|
|
|
|
data = loadData('berries.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
berry = Berry.objects.get(pk = int(info[0]))
|
|
|
|
berry.nature = Nature.objects.get(pk = int(info[4]))
|
|
|
|
berry.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(NatureName)
|
|
|
|
data = loadData('nature_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
natureName = NatureName (
|
|
|
|
nature = Nature.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
natureName.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(NaturePokeathlonStat)
|
|
|
|
data = loadData('nature_pokeathlon_stats.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(NatureBattleStylePreference)
|
|
|
|
data = loadData('nature_battle_style_preferences.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = NatureBattleStylePreference (
|
|
|
|
nature = Nature.objects.get(pk = int(info[0])),
|
2015-11-08 21:26:02 +00:00
|
|
|
move_battle_style = MoveBattleStyle.objects.get(pk = int(info[1])),
|
2015-10-29 17:45:58 +00:00
|
|
|
low_hp_preference = info[2],
|
|
|
|
high_hp_preference = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###########
|
|
|
|
# GENDER #
|
|
|
|
###########
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Gender)
|
|
|
|
data = loadData('genders.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Gender (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
################
|
|
|
|
# EXPERIENCE #
|
|
|
|
################
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Experience)
|
|
|
|
data = loadData('experience.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Experience (
|
|
|
|
growth_rate = GrowthRate.objects.get(pk = int(info[0])),
|
|
|
|
level = int(info[1]),
|
|
|
|
experience = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
##############
|
|
|
|
# MACHINES #
|
|
|
|
##############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Machine)
|
|
|
|
data = loadData('machines.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Machine (
|
|
|
|
machine_number = int(info[0]),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
item = Item.objects.get(pk = int(info[2])),
|
|
|
|
move = Move.objects.get(pk = int(info[3])),
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###############
|
|
|
|
# EVOLUTION #
|
|
|
|
###############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EvolutionChain)
|
|
|
|
data = loadData('evolution_chains.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EvolutionChain (
|
|
|
|
id = int(info[0]),
|
|
|
|
baby_trigger_item = Item.objects.get(pk = int(info[1])) if info[1] != '' else None,
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EvolutionTrigger)
|
|
|
|
data = loadData('evolution_triggers.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EvolutionTrigger (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EvolutionTriggerName)
|
|
|
|
data = loadData('evolution_trigger_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EvolutionTriggerName (
|
|
|
|
evolution_trigger = EvolutionTrigger.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
#############
|
|
|
|
# POKEDEX #
|
|
|
|
#############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Pokedex)
|
|
|
|
data = loadData('pokedexes.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Pokedex (
|
|
|
|
id = int(info[0]),
|
|
|
|
region = Region.objects.get(pk = int(info[1])) if info[1] != '' else None,
|
|
|
|
name = info[2],
|
|
|
|
is_main_series = bool(int(info[3]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-27 13:36:33 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokedexName)
|
|
|
|
clearTable(PokedexDescription)
|
|
|
|
data = loadData('pokedex_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
description_model = PokedexDescription (
|
|
|
|
pokedex = Pokedex.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[3]
|
|
|
|
)
|
|
|
|
description_model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokedexVersionGroup)
|
|
|
|
data = loadData('pokedex_version_groups.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokedexVersionGroup (
|
|
|
|
pokedex = Pokedex.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
##############
|
|
|
|
# LOCATION #
|
|
|
|
##############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Location)
|
|
|
|
data = loadData('locations.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Location (
|
|
|
|
id = int(info[0]),
|
|
|
|
region = Region.objects.get(pk = int(info[1])) if info[1] != '' else None,
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(LocationName)
|
|
|
|
data = loadData('location_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = LocationName (
|
|
|
|
location = Location.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(LocationGameIndex)
|
|
|
|
data = loadData('location_game_indices.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = LocationGameIndex (
|
|
|
|
location = Location.objects.get(pk = int(info[0])),
|
|
|
|
generation = Generation.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(LocationArea)
|
|
|
|
data = loadData('location_areas.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-11-08 21:26:02 +00:00
|
|
|
location = Location.objects.get(pk = int(info[1]))
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 19:09:28 +00:00
|
|
|
model = LocationArea (
|
2015-11-08 21:26:02 +00:00
|
|
|
id = int(info[0]),
|
|
|
|
location = location,
|
|
|
|
game_index = int(info[2]),
|
|
|
|
name = '{}-{}'.format(location.name, info[3]) if info[3] else '{}-{}'.format(location.name, 'area')
|
|
|
|
)
|
2015-10-29 19:09:28 +00:00
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(LocationAreaName)
|
|
|
|
data = loadData('location_area_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = LocationAreaName (
|
|
|
|
location_area = LocationArea.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
|
|
|
|
#############
|
|
|
|
# POKEMON #
|
|
|
|
#############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonColor)
|
|
|
|
data = loadData('pokemon_colors.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonColor (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonColorName)
|
|
|
|
data = loadData('pokemon_color_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonColorName (
|
|
|
|
pokemon_color = PokemonColor.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonShape)
|
|
|
|
data = loadData('pokemon_shapes.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonShape (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonShapeName)
|
|
|
|
data = loadData('pokemon_shape_prose.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonShapeName (
|
|
|
|
pokemon_shape = PokemonShape.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
awesome_name = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonHabitat)
|
|
|
|
data = loadData('pokemon_habitats.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonHabitat (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonSpecies)
|
|
|
|
data = loadData('pokemon_species.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonSpecies (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
generation = Generation.objects.get(pk = int(info[2])),
|
|
|
|
evolves_from_species = None,
|
|
|
|
evolution_chain = EvolutionChain.objects.get(pk = int(info[4])),
|
|
|
|
pokemon_color = PokemonColor.objects.get(pk = int(info[5])),
|
|
|
|
pokemon_shape = PokemonShape.objects.get(pk = int(info[6])),
|
|
|
|
pokemon_habitat = PokemonHabitat.objects.get(pk = int(info[7])) if info[7] != '' else None,
|
|
|
|
gender_rate = int(info[8]),
|
|
|
|
capture_rate = int(info[9]),
|
|
|
|
base_happiness = int(info[10]),
|
|
|
|
is_baby = bool(int(info[11])),
|
|
|
|
hatch_counter = int(info[12]),
|
|
|
|
has_gender_differences = bool(int(info[13])),
|
|
|
|
growth_rate = GrowthRate.objects.get(pk = int(info[14])),
|
|
|
|
forms_switchable = bool(int(info[15])),
|
|
|
|
order = int(info[16])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
data = loadData('pokemon_species.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
evolves = PokemonSpecies.objects.get(pk = int(info[3])) if info[3] != '' else None
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
if evolves:
|
|
|
|
species = PokemonSpecies.objects.get(pk = int(info[0]))
|
|
|
|
species.evolves_from_species = evolves
|
|
|
|
species.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonSpeciesName)
|
|
|
|
data = loadData('pokemon_species_names.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-27 13:36:33 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonSpeciesName (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
genus = info[3]
|
2015-10-27 13:36:33 +00:00
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonSpeciesDescription)
|
|
|
|
data = loadData('pokemon_species_prose.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonSpeciesDescription (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
description = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonSpeciesFlavorText)
|
|
|
|
data = loadData('pokemon_species_flavor_text.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonSpeciesFlavorText (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
version = Version.objects.get(pk = int(info[1])),
|
|
|
|
language = Language.objects.get(pk = int(info[2])),
|
|
|
|
flavor_text = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Pokemon)
|
|
|
|
data = loadData('pokemon.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Pokemon (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[2])),
|
|
|
|
height = int(info[3]),
|
|
|
|
weight = int(info[4]),
|
|
|
|
base_experience = int(info[5]),
|
|
|
|
order = int(info[6]),
|
|
|
|
is_default = bool(int(info[7]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-10-23 04:56:01 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonAbility)
|
|
|
|
data = loadData('pokemon_abilities.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonAbility (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
ability = Ability.objects.get(pk = int(info[1])),
|
|
|
|
is_hidden = bool(int(info[2])),
|
|
|
|
slot = int(info[3])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonDexNumber)
|
|
|
|
data = loadData('pokemon_dex_numbers.csv')
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-10-23 04:56:01 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonDexNumber (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
pokedex = Pokedex.objects.get(pk = int(info[1])),
|
|
|
|
pokedex_number = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonEggGroup)
|
|
|
|
data = loadData('pokemon_egg_groups.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonEggGroup (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
egg_group = EggGroup.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonEvolution)
|
|
|
|
data = loadData('pokemon_evolution.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
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()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonForm)
|
|
|
|
data = loadData('pokemon_forms.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonForm (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
form_name = info[2],
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[3])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[4])),
|
|
|
|
is_default = bool(int(info[5])),
|
|
|
|
is_battle_only = bool(int(info[6])),
|
|
|
|
is_mega = bool(int(info[7])),
|
|
|
|
form_order = int(info[8]),
|
|
|
|
order = int(info[9])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonFormName)
|
|
|
|
data = loadData('pokemon_form_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonFormName (
|
|
|
|
pokemon_form = PokemonForm.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
pokemon_name = info[3]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonFormGeneration)
|
|
|
|
data = loadData('pokemon_form_generations.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonFormGeneration (
|
|
|
|
pokemon_form = PokemonForm.objects.get(pk = int(info[0])),
|
|
|
|
generation = Generation.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonGameIndex)
|
|
|
|
data = loadData('pokemon_game_indices.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonGameIndex (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
version = Version.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonGameIndex)
|
|
|
|
data = loadData('pokemon_game_indices.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonGameIndex (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
version = Version.objects.get(pk = int(info[1])),
|
|
|
|
game_index = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonHabitatName)
|
|
|
|
data = loadData('pokemon_habitat_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonHabitatName (
|
|
|
|
pokemon_habitat = PokemonHabitat.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonItem)
|
|
|
|
data = loadData('pokemon_items.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonItem (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
version = Version.objects.get(pk = int(info[1])),
|
|
|
|
item = Item.objects.get(pk = int(info[2])),
|
|
|
|
rarity = int(info[3])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonMove)
|
|
|
|
data = loadData('pokemon_moves.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonMove (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
move = Move.objects.get(pk = int(info[2])),
|
|
|
|
move_learn_method = MoveLearnMethod.objects.get(pk = int(info[3])),
|
|
|
|
level = int(info[4]),
|
|
|
|
order = int(info[5]) if info[5] != '' else None,
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonStat)
|
|
|
|
data = loadData('pokemon_stats.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonStat (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
stat = Stat.objects.get(pk = int(info[1])),
|
|
|
|
base_stat = int(info[2]),
|
|
|
|
effort = int(info[3])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PokemonType)
|
|
|
|
data = loadData('pokemon_types.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PokemonType (
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[0])),
|
|
|
|
type = Type.objects.get(pk = int(info[1])),
|
|
|
|
slot = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
###############
|
|
|
|
# ENCOUNTER #
|
|
|
|
###############
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterMethod)
|
|
|
|
data = loadData('encounter_methods.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterMethod (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1],
|
|
|
|
order = int(info[2])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-11-05 14:55:14 +00:00
|
|
|
# LocationAreaEncounterRate/EncounterMethod associations
|
|
|
|
"""
|
|
|
|
I tried handling this the same way Berry/Natures are handled
|
|
|
|
but for some odd reason it resulted in a ton of db table issues.
|
|
|
|
It was easy enough to move LocationAreaEncounterRates below
|
|
|
|
Encounter population and for some reason things works now.
|
|
|
|
"""
|
|
|
|
clearTable(LocationAreaEncounterRate)
|
|
|
|
data = loadData('location_area_encounter_rates.csv')
|
|
|
|
|
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
|
|
|
|
|
|
|
model = LocationAreaEncounterRate (
|
|
|
|
location_area = LocationArea.objects.get(pk = int(info[0])),
|
|
|
|
encounter_method = EncounterMethod.objects.get(pk=info[1]),
|
|
|
|
version = Version.objects.get(pk = int(info[2])),
|
|
|
|
rate = int(info[3])
|
|
|
|
)
|
|
|
|
model.save()
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterMethodName)
|
|
|
|
data = loadData('encounter_method_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterMethodName (
|
|
|
|
encounter_method = EncounterMethod.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterSlot)
|
|
|
|
data = loadData('encounter_slots.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterSlot (
|
|
|
|
id = int(info[0]),
|
|
|
|
version_group = VersionGroup.objects.get(pk = int(info[1])),
|
|
|
|
encounter_method = EncounterMethod.objects.get(pk = int(info[2])),
|
|
|
|
slot = int(info[3]) if info[3] != '' else None,
|
|
|
|
rarity = int(info[4])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterCondition)
|
|
|
|
data = loadData('encounter_conditions.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterCondition (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterConditionName)
|
|
|
|
data = loadData('encounter_condition_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterConditionName (
|
|
|
|
encounter_condition = EncounterCondition.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(Encounter)
|
|
|
|
data = loadData('encounters.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = Encounter (
|
|
|
|
id = int(info[0]),
|
|
|
|
version = Version.objects.get(pk = int(info[1])),
|
|
|
|
location_area = LocationArea.objects.get(pk = int(info[2])),
|
|
|
|
encounter_slot = EncounterSlot.objects.get(pk = int(info[3])),
|
|
|
|
pokemon = Pokemon.objects.get(pk = int(info[4])),
|
|
|
|
min_level = int(info[5]),
|
|
|
|
max_level = int(info[6])
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterConditionValue)
|
|
|
|
data = loadData('encounter_condition_values.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterConditionValue (
|
|
|
|
id = int(info[0]),
|
|
|
|
encounter_condition = EncounterCondition.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
is_default = bool(int(info[3]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterConditionValueName)
|
|
|
|
data = loadData('encounter_condition_value_prose.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterConditionValueName (
|
|
|
|
encounter_condition_value = EncounterConditionValue.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2],
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(EncounterConditionValueMap)
|
|
|
|
data = loadData('encounter_condition_value_map.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = EncounterConditionValueMap (
|
|
|
|
encounter = Encounter.objects.get(pk = int(info[0])),
|
|
|
|
encounter_condition_value = EncounterConditionValue.objects.get(pk = int(info[1]))
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
##############
|
|
|
|
# PAL PARK #
|
|
|
|
##############
|
|
|
|
|
|
|
|
clearTable(PalParkArea)
|
|
|
|
data = loadData('pal_park_areas.csv')
|
|
|
|
|
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PalParkArea (
|
|
|
|
id = int(info[0]),
|
|
|
|
name = info[1]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PalParkAreaName)
|
|
|
|
data = loadData('pal_park_area_names.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PalParkAreaName (
|
|
|
|
pal_park_area = PalParkArea.objects.get(pk = int(info[0])),
|
|
|
|
language = Language.objects.get(pk = int(info[1])),
|
|
|
|
name = info[2]
|
|
|
|
)
|
|
|
|
model.save()
|
2015-04-21 03:31:59 +00:00
|
|
|
|
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
clearTable(PalPark)
|
|
|
|
data = loadData('pal_park.csv')
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
for index, info in enumerate(data):
|
|
|
|
if index > 0:
|
2015-04-21 03:31:59 +00:00
|
|
|
|
2015-10-29 17:45:58 +00:00
|
|
|
model = PalPark (
|
|
|
|
pokemon_species = PokemonSpecies.objects.get(pk = int(info[0])),
|
|
|
|
pal_park_area = PalParkArea.objects.get(pk = int(info[1])),
|
2015-11-08 21:26:02 +00:00
|
|
|
base_score = int(info[2]),
|
|
|
|
rate = int(info[3])
|
2015-10-29 17:45:58 +00:00
|
|
|
)
|
|
|
|
model.save()
|