@admin.route('/abc', methods=['GET','POST'])
def abc():
abc = {'username': '456', 'email': '456@163.com', 'fname': '789', 'status': '1'}, {'username': '123', 'email': '456@163.com', 'fname': '789', 'status': '1'}
flask 如何批量提交数据库中
谢谢!!
@admin.route('/abc', methods=['GET','POST'])
def abc():
abc = {'username': '456', 'email': '456@163.com', 'fname': '789', 'status': '1'}, {'username': '123', 'email': '456@163.com', 'fname': '789', 'status': '1'}
flask 如何批量提交数据库中
谢谢!!
case = []
for i in data:
username = i['username']
email = i['email']
obj = User(username=username,email=email)
case.append(obj)
网上找的答案。