python学习教程(八)sqlalchemy的classic映射
from dbproject.dbsetting import People,Teacher,enginefrom sqlalchemy.orm import sessionmakerpeople = People()teahcer = Teacher()people.name='renlei'people.id=1teahcer.name='laoshi'teahcer.id=1Session = sessionmaker()Session.configure(bind=engine)session = Session()session.add(people)session.add(teahcer)session.flush()session.commit()