Never mind. My mistake. --Randall Randall Smith wrote: > This is the error: Note that the first param is an SA object instead of > the integer key. > > sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'SELECT > records_tinwsys.tinwsys_st_code AS records_tinwsys_tinwsys_st_code, > records_tinwsys.tinwsys_is_number AS records_tinwsys_tinwsys_is_number, > records_tinwsys.record_id AS records_tinwsys_record_id \nFROM > efile2.records_tinwsys \nWHERE records_tinwsys.record_id = > %(records_tinwsys_record_id)s AND records_tinwsys.tinwsys_is_number = > %(records_tinwsys_tinwsys_is_number)s AND > records_tinwsys.tinwsys_st_code = %(records_tinwsys_tinwsys_st_code)s > ORDER BY records_tinwsys.record_id' {'records_tinwsys_record_id': > <mswater.lib.dblib.sqla.classes.efile.Record object at 0xb73324ac>, > 'records_tinwsys_tinwsys_st_code': 'MS', > 'records_tinwsys_tinwsys_is_number': 327L} > > Here is the intermediate table: > > table = Table('records_tingeoar', metadata, > Column('record_id', Integer, primary_key=True), > Column('tingeoar_is_number', Integer, primary_key=True), > Column('tingeoar_st_code', CHAR(2), primary_key=True), > ForeignKeyConstraint(['record_id', ], [records.c.id, ], > "records_tinwsys_record_id_fk", > onupdate="CASCADE", ondelete="CASCADE"), > ForeignKeyConstraint(['tingeoar_is_number', 'tingeoar_st_code'], > [tingeoar.c.tingeoar_is_number, > tingeoar.c.tingeoar_st_code], > "records_tingeoar_tingeoar_fk", > onupdate="CASCADE", ondelete="NO ACTION"), > schema=schemaname, > ) > > And here are the mapper definitions: > > RecordTinwsys.mapper = sa.mapper(RecordTinwsys, records_tinwsys, > primary_key=[records_tinwsys.c.record_id, > records_tinwsys.c.tinwsys_is_number, > records_tinwsys.c.tinwsys_st_code], > properties={ > 'record' : sa.relation(Record), > 'tinwsys' : sa.relation(Tinwsys) > } > ) > > Record.mapper = sa.mapper(Record, records, > properties={ > 'tinwsys' : sa.relation(Tinwsys, secondary=records_tinwsys, > backref='efile_records'), > 'tingeoar' : sa.relation(Tingeoar, secondary=records_tingeoar, > backref='efile_records'), > } > ) > > The error occurs where I access the backref attribute 'efile_records' > for Tinwsys. > > Randall > > > > >
--~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---