here is the code I am using to copy the database:
engine_src = create_engine('mssql://blah_blah_blah)
engine_dst = create_engine('sqlite:///new.sqlite')
metadata_src = MetaData(bind=engine_src,reflect=True)
metadata_dst = MetaData(bind=engine_dst)
for table in metadata_src.sorted_tables:
de
there is something really wired about orm.clear_mappers() function.
here is what i did:
1. I used a mapper to add an instance to a session, i.e
session.add(instance)
2. use clear_mappers() to clear all existing mapper
3. define another mapper using mapper(), including a 1:N relationship
in it.