sqlalchemy.exc.noforeignkeyserror: could not determine join condition between parent/child tables on relationship wife.wife - the

错误提示:

sqlalchemy.exc.noforeignkeyserror: could not determine join condition between parent/child tables on relationship wife.wife - there are no foreign keys linking these tables. ensure that referencing columns are associated with a foreignkey or foreignkeyconstraint, or specify a 'primaryjoin' expression.

分析过程:

我看懂了报错原因,按照网上的解决方法都试了一遍,都没有效果,人都要炸了,

最后发现:

我把代码写错地方了,放错了类,本来是给一个teacher类的设置外键,但是直接加到了wife的下面,所以一遍又一遍地检查了语法,大小写,类名,始终没有发现问题所在。

之后查错,除了看看语句本身有没有错,再看看位置写没写错吧!

posted @   胡安  阅读(336)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
点击右上角即可分享
微信分享提示