from sqlalchemy import Column
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
def make_model(fanyi_en_zh):
Base = declarative_base() # 生成一个SQLORM基类
class fanyi(Base):
# 表的名字:字的基本描述
__tablename__ = fanyi_en_zh
# 表的结构:
src = Column(String(255))
dst = Column(String(255))
__mapper_args__ = {
'primary_key': {src}
}
return fanyi