首页 新闻 赞助 找找看

python的flask在执行数据库是报错

0
[已解决问题] 解决于 2017-09-11 09:19

sqlalchemy.exc.InvalidRequestError

sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.IntegrityError) NOT NULL constraint failed: follows.follower_id [SQL: 'INSERT INTO follows (followed_id, timestamp) VALUES (?, ?)'] [parameters: (100, '2017-09-08 07:31:07.391094')]

 

小弟新手,哪位大牛给看看是为什么

左手十字的主页 左手十字 | 菜鸟二级 | 园豆:204
提问于:2017-09-08 16:54
< >
分享
最佳答案
0

parameters的值没有替换followed_id变量,仔细检查一下格式化传递值

奖励园豆:5
悟行 | 专家六级 |园豆:12559 | 2017-09-08 17:01

谢谢

左手十字 | 园豆:204 (菜鸟二级) | 2017-09-11 09:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册