Add a couple relations for move effect changelogs.
authorEevee <git@veekun.com>
Thu, 10 Feb 2011 07:37:41 +0000 (23:37 -0800)
committerEevee <git@veekun.com>
Thu, 10 Feb 2011 07:39:03 +0000 (23:39 -0800)
pokedex/db/tables.py

index b5f1d7d..460cfc2 100644 (file)
@@ -1451,8 +1451,14 @@ MoveChangelog.short_effect = markdown.MoveEffectProperty('short_effect')
 
 MoveEffect.category_map = relation(MoveEffectCategoryMap)
 MoveEffect.categories = association_proxy('category_map', 'category')
+MoveEffect.changelog = relation(MoveEffectChangelog,
+    order_by=MoveEffectChangelog.changed_in_version_group_id.desc(),
+    backref='move_effect',
+)
 MoveEffectCategoryMap.category = relation(MoveEffectCategory)
 
+MoveEffectChangelog.changed_in = relation(VersionGroup, backref='move_effect_changelog')
+
 MoveFlag.flag = relation(MoveFlagType)
 
 MoveFlavorText.version_group = relation(VersionGroup)