sqlalchemy.exe.InvaldRequestError 报错解决办法

sqlalchemy.exe.InvaldRequestError 报错解决办法

from models import OrderInfo 
from sqlalchemy.exc import InvalidRequestError
try:
    order = OrderInfo.query.filter_by(task_id=user_dict.get("task_id")).first()
    order.status = "COMPLETE"
    db.session.commit()
except InvalidRequestError:
    db.session.rollback()
except Exception as e:
    print(e)

你可能感兴趣的:(sqlalchemy.exe.InvaldRequestError 报错解决办法)