[Sqlalchemy-tickets] Issue #3129: automap: Please include documentation how to remap the relationsh
Brought to you by:
zzzeek
|
From: Priit L. <iss...@bi...> - 2014-07-15 11:09:37
|
New issue 3129: automap: Please include documentation how to remap the relationship https://bitbucket.org/zzzeek/sqlalchemy/issue/3129/automap-please-include-documentation-how Priit Laes: When trying to automap legacy database which has some issues with foreign key naming I ran into following issue. Having following two tables, it barfs because of naming conflict between column `table_b.table_a` and relationship `table_b->table_a` ``` #!python table_a: id table_b: id table_a (foreign key to table_a.id) ``` Error message nicely tells me to `To resolve this, map the column to the class under a different name in the 'properties' dictionary.`, but automap part of documentation doesn't mention much about this case. I have tried to override the class generation using following constructs, but still fail with error above: ``` #!python class Table_B(Base): __tablename__ = 'table_b' table_a = Column(ForeignKey('table_a.id')) ``` |