1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Merge branch 'generated-order'

This commit is contained in:
Lynn "Zhorken" Vaughan 2012-06-21 14:07:22 -04:00
commit 13e2709668
4 changed files with 1440 additions and 1380 deletions
pokedex/db

View file

@ -1267,8 +1267,11 @@ class PokemonForm(TableBase):
info=dict(description=u'Set for exactly one form used as the default for each pokemon (not necessarily species).'))
is_battle_only = Column(Boolean, nullable=False,
info=dict(description=u'Set iff the form can only appear in battle.'))
form_order = Column(Integer, nullable=False, autoincrement=False,
info=dict(description=u"The order in which forms should be sorted within a species' forms. Multiple forms may have equal order, in which case they should fall back on sorting by name. "
u"Used in generating `pokemon_forms.order` and `pokemon.order`."))
order = Column(Integer, nullable=False, autoincrement=False,
info=dict(description=u'The order in which forms should be sorted. Multiple forms may have equal order, in which case they should fall back on sorting by name.'))
info=dict(description=u'The order in which forms should be sorted within all forms. Multiple forms may have equal order, in which case they should fall back on sorting by name.'))
@property
def name(self):
@ -1443,6 +1446,8 @@ class PokemonSpecies(TableBase):
info=dict(description="ID of the growth rate for this family"))
forms_switchable = Column(Boolean, nullable=False,
info=dict(description=u"True iff a particular individual of this species can switch beween its different forms."))
order = Column(Integer, nullable=False, index=True,
info=dict(description=u'The order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage.'))
create_translation_table('pokemon_species_names', PokemonSpecies, 'names',
relation_lazy='joined',
@ -2094,7 +2099,7 @@ PokemonSpecies.egg_groups = relationship(EggGroup,
secondary=PokemonEggGroup.__table__,
innerjoin=True,
order_by=PokemonEggGroup.egg_group_id.asc(),
backref=backref('species', order_by=Pokemon.order.asc()))
backref=backref('species', order_by=PokemonSpecies.order.asc()))
PokemonSpecies.forms = relationship(PokemonForm,
secondary=Pokemon.__table__,
primaryjoin=PokemonSpecies.id==Pokemon.species_id,