class Bench(object): _mapper = {} @staticmethod def model(id): # table_index = id if int(id) < 10: class_name = 'Bench0%d' % id else: class_name = 'Bench%d' % id print(class_name) ModelClass = Bench._mapper.get(class_name, None) if ModelClass is None: ModelClass = type(class_name, (db.Model,), { '__moduel__': __name__, '__name__': class_name, '__tablename__': class_name, 'id': db.Column(db.Integer, nullable=
python flask SQLAlchemy处理分表
最新推荐文章于 2024-05-31 18:17:11 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)