- changed status to resolved
rev 1686 breaking mapper
Issue #232
resolved
Here is a small test program that fails in rev 1686, file sqlalchemy/lib/sqlalchemy/orm/mapper.py line 196, in compile assert len(_compile_triggers) == 0
from sqlalchemy import *
metadata = MetaData(name='Test Metadata')
class Indice(object):
pass
class Company(object):
pass
class CompanyDailyTrading(object):
pass
class IndiceDailyTrading(object):
pass
indice_table = Table('indice', metadata,
Column('code', String(7), primary_key=True),
)
indice_trading_table = Table('indice_trading_history', metadata,
Column('code', String(7), ForeignKey('indice.code'), primary_key=True),
Column('date', DateTime, primary_key=True))
company_table = Table('company', metadata,
Column('code', String(7), primary_key=True))
company_trading_table = Table('company_trading_history', metadata,
Column('code', String(7), ForeignKey('company.code'), primary_key=True),
Column('date', DateTime, primary_key=True))
CompanyDailyTrading.mapper = mapper( CompanyDailyTrading, company_trading_table, is_primary=True)
IndiceDailyTrading.mapper = mapper( IndiceDailyTrading, indice_trading_table, is_primary=True)
Indice.mapper = mapper(Indice, indice_table,
properties = {
'daily_trading' : relation(IndiceDailyTrading.mapper, private=True, lazy=True,
primaryjoin=indice_table.c.code==IndiceDailyTrading.c.code),
},
is_primary=True)
Company.mapper = mapper(Company, company_table, is_primary=True,
properties={
'daily_trading' : relation(CompanyDailyTrading.mapper,
lazy=True,
primaryjoin=company_table.c.code==CompanyDailyTrading.c.code)
})
Comments (1)
-
repo owner - Log in to comment
yah, some sleep helped. changeset:1687