mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-25 12:50:18 +00:00
play: add some pokemon
This commit is contained in:
parent
47044317e4
commit
047575ff41
9 changed files with 944 additions and 829 deletions
|
@ -1264,21 +1264,21 @@ def _build_pokemons():
|
||||||
yield PokemonSpecies(
|
yield PokemonSpecies(
|
||||||
id=int(info[0]),
|
id=int(info[0]),
|
||||||
name=info[1],
|
name=info[1],
|
||||||
generation_id=int(info[2]),
|
generation_id=int(info[2]) if info[2] != "" else None,
|
||||||
evolves_from_species=None,
|
evolves_from_species=None,
|
||||||
evolution_chain_id=int(info[4]),
|
evolution_chain_id=int(info[4]) if info[4] != "" else None,
|
||||||
pokemon_color_id=int(info[5]),
|
pokemon_color_id=int(info[5]) if info[5] != "" else None,
|
||||||
pokemon_shape_id=int(info[6]),
|
pokemon_shape_id=int(info[6]) if info[6] != "" else None,
|
||||||
pokemon_habitat_id=int(info[7]) if info[7] != "" else None,
|
pokemon_habitat_id=int(info[7]) if info[7] != "" else None,
|
||||||
gender_rate=int(info[8]),
|
gender_rate=int(info[8]) if info[8] != "" else None,
|
||||||
capture_rate=int(info[9]),
|
capture_rate=int(info[9]) if info[9] != "" else None,
|
||||||
base_happiness=int(info[10]),
|
base_happiness=int(info[10]) if info[10] != "" else None,
|
||||||
is_baby=bool(int(info[11])),
|
is_baby=bool(int(info[11])) if info[11] != "" else None,
|
||||||
hatch_counter=int(info[12]),
|
hatch_counter=int(info[12]) if info[12] != "" else None,
|
||||||
has_gender_differences=bool(int(info[13])),
|
has_gender_differences=bool(int(info[13])) if info[13] != "" else None,
|
||||||
growth_rate_id=int(info[14]),
|
growth_rate_id=int(info[14]) if info[14] != "" else None,
|
||||||
forms_switchable=bool(int(info[15])),
|
forms_switchable=bool(int(info[15])) if info[15] != "" else None,
|
||||||
order=int(info[16]),
|
order=int(info[16]) if info[16] != "" else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
build_generic((PokemonSpecies,), "pokemon_species.csv", csv_record_to_objects)
|
build_generic((PokemonSpecies,), "pokemon_species.csv", csv_record_to_objects)
|
||||||
|
@ -1340,7 +1340,7 @@ def _build_pokemons():
|
||||||
height=int(info[3]) if info[3] != "" else None,
|
height=int(info[3]) if info[3] != "" else None,
|
||||||
weight=int(info[4]) if info[4] != "" else None,
|
weight=int(info[4]) if info[4] != "" else None,
|
||||||
base_experience=int(info[5]) if info[5] != "" else None,
|
base_experience=int(info[5]) if info[5] != "" else None,
|
||||||
order=int(info[6]) if info[6] != "" else None,
|
order=int(info[6]) if info[6] != "" else -1,
|
||||||
is_default=bool(int(info[7])) if info[7] != "" else None,
|
is_default=bool(int(info[7])) if info[7] != "" else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -41,3 +41,4 @@ generation_id,local_language_id,name
|
||||||
7,6,Generation VII
|
7,6,Generation VII
|
||||||
7,9,Generation VII
|
7,9,Generation VII
|
||||||
7,11,第七世代
|
7,11,第七世代
|
||||||
|
8,9,Generation VIII
|
||||||
|
|
|
|
@ -6,3 +6,4 @@ id,main_region_id,identifier
|
||||||
5,5,generation-v
|
5,5,generation-v
|
||||||
6,6,generation-vi
|
6,6,generation-vi
|
||||||
7,7,generation-vii
|
7,7,generation-vii
|
||||||
|
8,8,generation-viii
|
||||||
|
|
|
|
@ -887,9 +887,6 @@ id,identifier,species_id,height,weight,base_experience,order,is_default
|
||||||
888,zacian,888,28,1100,335,,1
|
888,zacian,888,28,1100,335,,1
|
||||||
889,zamazenta,889,29,2100,335,,1
|
889,zamazenta,889,29,2100,335,,1
|
||||||
890,eternatus,890,200,9500,345,,1
|
890,eternatus,890,200,9500,345,,1
|
||||||
891,kubfu,891,6,120,,,1
|
|
||||||
892,urshifu,892,19,1050,,,1
|
|
||||||
893,zarude,893,18,700,,,1
|
|
||||||
10001,deoxys-attack,386,17,608,270,497,0
|
10001,deoxys-attack,386,17,608,270,497,0
|
||||||
10002,deoxys-defense,386,17,608,270,498,0
|
10002,deoxys-defense,386,17,608,270,498,0
|
||||||
10003,deoxys-speed,386,17,608,270,499,0
|
10003,deoxys-speed,386,17,608,270,499,0
|
||||||
|
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,3 +36,4 @@ region_id,local_language_id,name
|
||||||
6,8,Kalos
|
6,8,Kalos
|
||||||
6,9,Kalos
|
6,9,Kalos
|
||||||
7,9,Alola
|
7,9,Alola
|
||||||
|
8,9,Galar
|
||||||
|
|
|
|
@ -6,3 +6,4 @@ id,identifier
|
||||||
5,unova
|
5,unova
|
||||||
6,kalos
|
6,kalos
|
||||||
7,alola
|
7,alola
|
||||||
|
8,galar
|
||||||
|
|
|
33
pokemon_v2/migrations/0007_auto_20200731_1914.py
Normal file
33
pokemon_v2/migrations/0007_auto_20200731_1914.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# Generated by Django 2.1.11 on 2020-07-31 19:14
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('pokemon_v2', '0006_auto_20200725_2205'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='pokemonspecies',
|
||||||
|
name='base_happiness',
|
||||||
|
field=models.IntegerField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='pokemonspecies',
|
||||||
|
name='capture_rate',
|
||||||
|
field=models.IntegerField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='pokemonspecies',
|
||||||
|
name='gender_rate',
|
||||||
|
field=models.IntegerField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='pokemonspecies',
|
||||||
|
name='hatch_counter',
|
||||||
|
field=models.IntegerField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1627,15 +1627,15 @@ class PokemonSpecies(
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
)
|
)
|
||||||
|
|
||||||
gender_rate = models.IntegerField()
|
gender_rate = models.IntegerField(blank=True, null=True)
|
||||||
|
|
||||||
capture_rate = models.IntegerField()
|
capture_rate = models.IntegerField(blank=True, null=True)
|
||||||
|
|
||||||
base_happiness = models.IntegerField()
|
base_happiness = models.IntegerField(blank=True, null=True)
|
||||||
|
|
||||||
is_baby = models.BooleanField(default=False)
|
is_baby = models.BooleanField(default=False)
|
||||||
|
|
||||||
hatch_counter = models.IntegerField()
|
hatch_counter = models.IntegerField(blank=True, null=True)
|
||||||
|
|
||||||
has_gender_differences = models.BooleanField(default=False)
|
has_gender_differences = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue