if you want to create multiple table objects, you could create a function to generate and return a new class. Maybe something like this:
Base = declarative_base()
def TableCreator(tablename):
class MyTable(Base):
__tablename__ = tablename
row_id = Column(INT, primary_key=True)
another_column = Column(CHAR(10))
return MyTable
dynamically creating a set of SQLAlchemy table
原文:http://my.oschina.net/u/2007546/blog/492513