X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/aaa7f3a9432e2a0d72732133d657e9c85bdc79b4..0383b7997dc0d64cfd686f1ca99d9d06f75b0268:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 3308ed9..7ed588f 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -15,6 +15,8 @@ Columns have a info dictionary with these keys: - identifier: A fan-made identifier in the [-_a-z0-9]* format. Not intended for translation. - latex: A formula in LaTeX syntax. +- ripped: True for text that has been ripped from the games, and can be ripped + again for new versions or languages See `pokedex.db.multilang` for how localizable text columns work. The session classes in that module can be used to change the default language. @@ -116,7 +118,7 @@ class Ability(TableBase): create_translation_table('ability_names', Ability, 'names', relation_lazy='joined', name = Column(Unicode(24), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=True)), + info=dict(description="The name", format='plaintext', official=True, ripped=True)), ) create_translation_table('ability_prose', Ability, 'prose', effect = Column(markdown.MarkdownColumn(5120), nullable=False, @@ -495,7 +497,7 @@ class Item(TableBase): create_translation_table('item_names', Item, 'names', relation_lazy='joined', name = Column(Unicode(20), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=True)), + info=dict(description="The name", format='plaintext', official=True, ripped=True)), ) create_translation_table('item_prose', Item, 'prose', short_effect = Column(Unicode(256), nullable=False, @@ -503,6 +505,10 @@ create_translation_table('item_prose', Item, 'prose', effect = Column(markdown.MarkdownColumn(5120), nullable=False, info=dict(description=u"Detailed description of the item's effect.", format='markdown')), ) +create_translation_table('item_flavor_summaries', Item, 'flavor_summaries', + flavor_summary = Column(Unicode(512), nullable=True, + info=dict(description=u"Text containing facts from all flavor texts, for languages without official game translations", official=False, format='plaintext', ripped=True)), +) class ItemCategory(TableBase): u"""An item category @@ -554,6 +560,7 @@ class ItemFlavorText(TableBase): """ __tablename__ = 'item_flavor_text' __singlename__ = 'item_flavor_text' + summary_column = Item.flavor_summaries_table, 'flavor_summary' item_id = Column(Integer, ForeignKey('items.id'), primary_key=True, autoincrement=False, nullable=False, info=dict(description="The ID of the item")) version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, autoincrement=False, nullable=False, @@ -722,7 +729,11 @@ class Move(TableBase): create_translation_table('move_names', Move, 'names', relation_lazy='joined', name = Column(Unicode(24), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=True)) + info=dict(description="The name", format='plaintext', official=True, ripped=True)) +) +create_translation_table('move_flavor_summaries', Move, 'flavor_summaries', + flavor_summary = Column(Unicode(512), nullable=True, + info=dict(description=u"Text containing facts from all flavor texts, for languages without official game translations", official=False, format='plaintext', ripped=True)), ) class MoveBattleStyle(TableBase): @@ -876,6 +887,7 @@ class MoveFlavorText(TableBase): u"""In-game description of a move """ __tablename__ = 'move_flavor_text' + summary_column = Move.flavor_summaries_table, 'flavor_summary' move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False, info=dict(description="ID of the move")) version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False, @@ -1001,7 +1013,7 @@ class Nature(TableBase): create_translation_table('nature_names', Nature, 'names', relation_lazy='joined', name = Column(Unicode(8), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=True)), + info=dict(description="The name", format='plaintext', official=True, ripped=True)), ) class NatureBattleStylePreference(TableBase): @@ -1191,11 +1203,15 @@ class Pokemon(TableBase): create_translation_table('pokemon_names', Pokemon, 'names', relation_lazy='joined', name = Column(Unicode(20), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=True)), + info=dict(description="The name", format='plaintext', official=True, ripped=True)), species = Column(Unicode(16), nullable=False, info=dict(description=u'The short flavor text, such as "Seed" or "Lizard"; usually affixed with the word "Pokémon"', official=True, format='plaintext')), ) +create_translation_table('pokemon_flavor_summaries', Pokemon, 'flavor_summaries', + flavor_summary = Column(Unicode(512), nullable=True, + info=dict(description=u"Text containing facts from all flavor texts, for languages without official game translations", official=False, format='plaintext', ripped=True)), +) class PokemonAbility(TableBase): u"""Maps an ability to a Pokémon that can have it @@ -1291,6 +1307,7 @@ class PokemonFlavorText(TableBase): u"""In-game Pokédex descrption of a Pokémon. """ __tablename__ = 'pokemon_flavor_text' + summary_column = Pokemon.flavor_summaries_table, 'flavor_summary' pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False, info=dict(description=u"ID of the Pokémon")) version_id = Column(Integer, ForeignKey('versions.id'), primary_key=True, nullable=False, autoincrement=False, @@ -1298,7 +1315,7 @@ class PokemonFlavorText(TableBase): language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False, info=dict(description="The language")) flavor_text = Column(Unicode(255), nullable=False, - info=dict(description=u"ID of the version that has this flavor text", official=True, format='gametext')) + info=dict(description=u"The flavor text", official=True, format='gametext')) class PokemonForm(TableBase): u"""An individual form of a Pokémon.