X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/43bae2c3a44a76dbd0279d6944bb01b16d1580c2..2c94dcb72535499c43958ceb9d1ca6af25740995:/pokedex/db/multilang.py?ds=inline diff --git a/pokedex/db/multilang.py b/pokedex/db/multilang.py index 8e067c6..dcbe489 100644 --- a/pokedex/db/multilang.py +++ b/pokedex/db/multilang.py @@ -77,9 +77,11 @@ def create_translation_table(_table_name, foreign_class, relation_name, # Create the table object table = Table(_table_name, foreign_class.__table__.metadata, Column(foreign_key_name, Integer, ForeignKey(foreign_class.id), - primary_key=True, nullable=False), + primary_key=True, nullable=False, + info=dict(description="ID of the %s these texts relate to" % foreign_class.__singlename__)), Column('local_language_id', Integer, ForeignKey(language_class.id), - primary_key=True, nullable=False), + primary_key=True, nullable=False, + info=dict(description="Language these texts are in")), ) Translations.__table__ = table @@ -97,7 +99,8 @@ def create_translation_table(_table_name, foreign_class, relation_name, 'foreign_id': synonym(foreign_key_name), 'local_language': relationship(language_class, primaryjoin=table.c.local_language_id == language_class.id, - innerjoin=True), + innerjoin=True, + lazy='joined'), }) # Add full-table relations to the original class