On Dec 22 2008, 7:10 pm, Eoghan Murray <eoghanomur...@gmail.com> wrote: > On Dec 22, 4:16 pm, "Gaetan de Menten" <gdemen...@gmail.com> wrote: > > > > > I'm not sure what you are trying to do, but MyE.f_1 and MyE.f_2 are > > not column objects. f_1_id and f_2_id are. > > Sorry, I edited down my example from a bigger version and made a > mistake — the following entiity class def might make better sense: > > class MyE(Entity): > id = Field(Integer, primary_key=True) > foreign_1 = ManyToOne('OtherE', colname='f_1') > foreign_2 = ManyToOne('OtherE', colname='f_2') > date = Field(Date)
I've stepped through the source and it seems that the adapter is mapping the second foreign column to the first foreign column (sqlalchemy/orm/query.py 1736) >>> adapter.columns { Column('f_1', String(length=50, convert_unicode=False, assert_unicode=None), ForeignKey('othere.id'), table=<mye>, nullable=False): Column('f_1', String(length=50, convert_unicode=False, assert_unicode=None), ForeignKey('othere.id'), table=<%(156419884 anon)s>, nullable=False), Column('id', Integer(), table=<mye>, primary_key=True, nullable=False): Column('id', Integer(), table=<%(156419884 anon)s>, primary_key=True, nullable=False), Column('f_2', String(length=50, convert_unicode=False, assert_unicode=None), ForeignKey('othere.id'), table=<mye>, nullable=False): Column('f_1', String(length=50, convert_unicode=False, assert_unicode=None), ForeignKey('othere.id'), table=<%(156419884 anon)s>, nullable=False) } I know this isn't much to go on, but anyone have any ideas? Thanks, Eoghan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---