首页 > 数据库 >sqlalchemy.exc.noforeignkeyserror: could not determine join condition between parent/child tables on

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

时间:2022-10-17 03:11:05浏览次数:51  
标签:tables sqlalchemy relationship wife determine between noforeignkeyserror

错误提示:
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的下面,所以一遍又一遍地检查了语法,大小写,类名,始终没有发现问题所在。

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

标签:tables,sqlalchemy,relationship,wife,determine,between,noforeignkeyserror
From: https://www.cnblogs.com/sherlock-V/p/16797769.html

相关文章

  • sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.list' is not mapped
    修改前@app.route('/add_course')defadd_course():course1=Course('python基础')course2=Course('Python高级')course3=Course('Pythonweb基础')......
  • 把sqlalchemy对象转化成json数据类型
    把sqlalchemy对象转化成json数据类型defto_json_all(msg:list):data=[]iftype(msg)==list:foriinrange(len(msg)):temp_dict......
  • 比较有意思的比较内表的小函数:CTVB_COMPARE_TABLES
    有时候自己开发tablecontrol的表维护,涉及到数据的增删改查,可以考虑用下函数 CTVB_COMPARE_TABLES包   :CT函数组:CTVB  函数模块:CTVB_COMPARE_TABLES C......
  • iptables 规则
    主要包含::  命令表    用来增加(-A、-I)删除(-D)修改(-R)查看(-L)规则等;                     常用参数  用来指定协议(-p)、源地址(-s)......
  • iptables
    iptables-AINPUT-s0.0.0.0/0-d0.0.0.0/0-ptcp--dport8910-jACCEPT   #允许any到any8910端口iptables-AINPUT-s0.0.0.0/0-d0.0.0.0/0-ptcp--dpor......
  • ETCD 未授权访问漏洞-添加iptables规则修复方法
    ⻛险提⽰1.在iptables规则配置正确的情况下,可以规避未认证的漏洞;2.如变更过程中误操作限制了其他端⼝的情况下可能会造成存储异常;影响版本所有版本问题描述:客⼾采......
  • iptables基本使用举例
    一、链的基本操作1、清除所有的规则。1)清除预设表filter中所有规则链中的规则。#iptables-F2)清除预设表filter中使用者自定链中的规则。#iptables-X#iptables-Z......
  • Flask学习笔记(八)-Flask-Sqlalchemy基本使用详解
    一、环境的安装pipinstallflask-sqlalchemypipinstallpymysql二、基本使用1、最小型应用:对于Flask的应用来说,需要做的就是为Flask实例选择加载配置,然后把S......
  • ORA-1536: space quota exceeded for tablespace
    Error: ORA1536Text:  spacequotaexceededfortablespace"<name>"-------------------------------------------------------------------------------Cause:......
  • 5.iptables ddos
    1syn拒绝服务攻击,SYN攻击原理SYN洪水攻击是DDOS攻击中最常见的攻击类型之一。是一种利用TCP协议缺陷,攻击者向被攻击的主机发送大量伪造的TCP连接请求,从而使得被攻击方......