mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Turn PalPark.area Enum into a table.
This commit is contained in:
parent
6e2f7af7b2
commit
48c3eff597
4 changed files with 527 additions and 495 deletions
pokedex/db
|
@ -1030,13 +1030,29 @@ class PalPark(TableBase):
|
|||
species_id = Column(Integer, ForeignKey('pokemon_species.id'), primary_key=True,
|
||||
info=dict(description="ID of the Pokémon species this data pertains to"))
|
||||
|
||||
area = Column(Enum('forest', 'field', 'mountain', 'pond', 'sea', name='pal_park_areas'), nullable=False,
|
||||
area_id = Column(Integer, ForeignKey('pal_park_areas.id'), nullable=False,
|
||||
info=dict(description="The area in which this Pokémon can be found"))
|
||||
base_score = Column(Integer, nullable=False,
|
||||
info=dict(description="Value used in calculating the player's score in a Pal Park run"))
|
||||
rate = Column(Integer, nullable=False,
|
||||
info=dict(description="Base rate for encountering this Pokémon"))
|
||||
|
||||
class PalParkArea(TableBase):
|
||||
u"""Pal Park areas enum
|
||||
"""
|
||||
__tablename__ = 'pal_park_areas'
|
||||
__singlename__ = 'pal_park_area'
|
||||
|
||||
id = Column(Integer, primary_key=True, nullable=False,
|
||||
info=dict(description="A numeric ID"))
|
||||
identifier = Column(Unicode(8), nullable=False,
|
||||
info=dict(description="An identifier"))
|
||||
|
||||
create_translation_table('pal_park_area_names', PalParkArea, 'names',
|
||||
name = Column(Unicode(8), nullable=False, index=True,
|
||||
info=dict(description="The name", format='plaintext', official=False)),
|
||||
)
|
||||
|
||||
class PokeathlonStat(TableBase):
|
||||
u"""A Pokéathlon stat, such as "Stamina" or "Jump".
|
||||
"""
|
||||
|
@ -1921,6 +1937,10 @@ NaturePokeathlonStat.pokeathlon_stat = relationship(PokeathlonStat,
|
|||
backref='nature_effects')
|
||||
|
||||
|
||||
PalPark.area = relationship(PalParkArea,
|
||||
innerjoin=True, lazy='joined')
|
||||
|
||||
|
||||
Pokedex.region = relationship(Region,
|
||||
innerjoin=True,
|
||||
backref='pokedexes')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue