From: Eevee Date: Fri, 25 Mar 2011 02:37:12 +0000 (-0700) Subject: Rename internal_id to game_index. X-Git-Tag: veekun-promotions/2011041101~33^2~3 X-Git-Url: http://git.veekun.com/zzz-pokedex.git/commitdiff_plain/19b623b437e4005899e3bf0aee6f6d3fa287e26f?hp=--cc Rename internal_id to game_index. --- 19b623b437e4005899e3bf0aee6f6d3fa287e26f diff --git a/pokedex/data/csv/item_internal_ids.csv b/pokedex/data/csv/item_game_indices.csv similarity index 99% rename from pokedex/data/csv/item_internal_ids.csv rename to pokedex/data/csv/item_game_indices.csv index 69349c5..153763f 100644 --- a/pokedex/data/csv/item_internal_ids.csv +++ b/pokedex/data/csv/item_game_indices.csv @@ -1,4 +1,4 @@ -item_id,generation_id,internal_id +item_id,generation_id,game_index 1,3,1 1,4,1 1,5,1 diff --git a/pokedex/data/csv/location_areas.csv b/pokedex/data/csv/location_areas.csv index c4abce7..648446b 100644 --- a/pokedex/data/csv/location_areas.csv +++ b/pokedex/data/csv/location_areas.csv @@ -1,4 +1,4 @@ -id,location_id,internal_id,identifier +id,location_id,game_index,identifier 1,1,1, 2,2,2, 3,3,3, diff --git a/pokedex/data/csv/location_internal_ids.csv b/pokedex/data/csv/location_game_indices.csv similarity index 98% rename from pokedex/data/csv/location_internal_ids.csv rename to pokedex/data/csv/location_game_indices.csv index 7e11ecf..798db39 100644 --- a/pokedex/data/csv/location_internal_ids.csv +++ b/pokedex/data/csv/location_game_indices.csv @@ -1,4 +1,4 @@ -location_id,generation_id,internal_id +location_id,generation_id,game_index 1,4,7 2,4,9 3,4,11 diff --git a/pokedex/data/csv/pokemon_internal_ids.csv b/pokedex/data/csv/pokemon_game_indices.csv similarity index 99% rename from pokedex/data/csv/pokemon_internal_ids.csv rename to pokedex/data/csv/pokemon_game_indices.csv index a5664e6..3c4032a 100644 --- a/pokedex/data/csv/pokemon_internal_ids.csv +++ b/pokedex/data/csv/pokemon_game_indices.csv @@ -1,4 +1,4 @@ -pokemon_id,generation_id,internal_id +pokemon_id,generation_id,game_index 1,1,153 1,2,1 1,3,1 diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 48fed81..aaa2fcb 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -574,15 +574,15 @@ create_translation_table('item_fling_effect_prose', ItemFlingEffect, 'prose', info=dict(description="Description of the effect", format='plaintext')), ) -class ItemInternalID(TableBase): +class ItemGameIndex(TableBase): u"""The internal ID number a game uses for an item """ - __tablename__ = 'item_internal_ids' + __tablename__ = 'item_game_indices' item_id = Column(Integer, ForeignKey('items.id'), primary_key=True, autoincrement=False, nullable=False, info=dict(description="The database ID of the item")) generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False, info=dict(description="ID of the generation of games")) - internal_id = Column(Integer, nullable=False, + game_index = Column(Integer, nullable=False, info=dict(description="Internal ID of the item in the generation")) class ItemPocket(TableBase): @@ -626,7 +626,7 @@ class LocationArea(TableBase): info=dict(description="A numeric ID")) location_id = Column(Integer, ForeignKey('locations.id'), nullable=False, info=dict(description="ID of the location this area is part of")) - internal_id = Column(Integer, nullable=False, + game_index = Column(Integer, nullable=False, info=dict(description="ID the games ude for this area")) identifier = Column(Unicode(64), nullable=True, info=dict(description="An identifier", format='identifier')) @@ -648,15 +648,15 @@ class LocationAreaEncounterRate(TableBase): rate = Column(Integer, nullable=True, info=dict(description="The encounter rate")) # units? -class LocationInternalID(TableBase): +class LocationGameIndex(TableBase): u"""IDs the games use internally for locations """ - __tablename__ = 'location_internal_ids' + __tablename__ = 'location_game_indices' location_id = Column(Integer, ForeignKey('locations.id'), nullable=False, primary_key=True, info=dict(description="Database ID of the locaion")) generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False, primary_key=True, info=dict(description="ID of the generation this entry to")) - internal_id = Column(Integer, nullable=False, + game_index = Column(Integer, nullable=False, info=dict(description="Internal game ID of the location")) class Machine(TableBase): @@ -1389,15 +1389,15 @@ create_translation_table('pokemon_habitat_names', PokemonHabitat, 'names', info=dict(description="The name", format='plaintext', official=True)), ) -class PokemonInternalID(TableBase): +class PokemonGameIndex(TableBase): u"""The number of a Pokémon a game uses internally """ - __tablename__ = 'pokemon_internal_ids' + __tablename__ = 'pokemon_game_indices' pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, autoincrement=False, nullable=False, info=dict(description=u"Database ID of the Pokémon")) generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False, info=dict(description=u"Database ID of the generation")) - internal_id = Column(Integer, nullable=False, + game_index = Column(Integer, nullable=False, info=dict(description=u"Internal ID the generation's games use for the Pokémon")) class PokemonItem(TableBase): @@ -1726,8 +1726,8 @@ ItemCategory.pocket = relation(ItemPocket) ItemFlavorText.version_group = relation(VersionGroup) ItemFlavorText.language = relation(Language) -ItemInternalID.item = relation(Item, backref='internal_ids') -ItemInternalID.generation = relation(Generation) +ItemGameIndex.item = relation(Item, backref='game_indices') +ItemGameIndex.generation = relation(Generation) ItemPocket.categories = relation(ItemCategory, order_by=ItemCategory.identifier) @@ -1735,8 +1735,8 @@ Location.region = relation(Region, backref='locations') LocationArea.location = relation(Location, backref='areas') -LocationInternalID.location = relation(Location, backref='internal_ids') -LocationInternalID.generation = relation(Generation) +LocationGameIndex.location = relation(Location, backref='game_indices') +LocationGameIndex.generation = relation(Generation) Machine.item = relation(Item) Machine.version_group = relation(VersionGroup) diff --git a/pokedex/struct/__init__.py b/pokedex/struct/__init__.py index 962377f..5b52539 100644 --- a/pokedex/struct/__init__.py +++ b/pokedex/struct/__init__.py @@ -128,8 +128,8 @@ class SaveFilePokemon(object): self._held_item = None if st.held_item_id: - self._held_item = session.query(tables.ItemInternalID) \ - .filter_by(generation_id = 4, internal_id = st.held_item_id).one().item + self._held_item = session.query(tables.ItemGameIndex) \ + .filter_by(generation_id = 4, game_index = st.held_item_id).one().item self._stats = [] for pokemon_stat in self._pokemon.stats: @@ -173,19 +173,19 @@ class SaveFilePokemon(object): pokeball_id = st.hgss_pokeball - 17 + 492 else: pokeball_id = st.dppt_pokeball - self._pokeball = session.query(tables.ItemInternalID) \ - .filter_by(generation_id = 4, internal_id = pokeball_id).one().item + self._pokeball = session.query(tables.ItemGameIndex) \ + .filter_by(generation_id = 4, game_index = pokeball_id).one().item egg_loc_id = st.pt_egg_location_id or st.dp_egg_location_id met_loc_id = st.pt_met_location_id or st.dp_met_location_id self._egg_location = None if egg_loc_id: - self._egg_location = session.query(tables.LocationInternalID) \ - .filter_by(generation_id = 4, internal_id = egg_loc_id).one().location + self._egg_location = session.query(tables.LocationGameIndex) \ + .filter_by(generation_id = 4, game_index = egg_loc_id).one().location - self._met_location = session.query(tables.LocationInternalID) \ - .filter_by(generation_id = 4, internal_id = met_loc_id).one().location + self._met_location = session.query(tables.LocationGameIndex) \ + .filter_by(generation_id = 4, game_index = met_loc_id).one().location @property def species(self):