JavaShuo
栏目
标签
Django外键(ForeignKey)操作时报错‘Projects‘ object has no attribute ‘interface_set‘
时间 2020-12-26
标签
Django
栏目
Python
繁體版
原文
原文链接
我定义了两个模型,一个是project模型,一个是interface模型 django默认情况下每一个主表的对象都有一个是外键的属性,可以通过它查询到所有关于子表的信息,这个属性的名字就是子表的名称小写加上_set,具体到这个就是interface_set,默认返回的是QuerySet, 在models.py使用Foreign定义外键的时候也可以传入一个参数related_name.之前的_set
>>阅读原文<<
相关文章
1.
解决 AttributeError: 'ForeignKey' object has no attribute 're'
2.
AttributeError: ‘NoneType‘ object has no attribute ‘author‘(Django操作数据库时)
3.
GNURadio报错: AttributeError: ‘module‘ object has no attribute ‘channelizer‘
4.
attributeError: NoneType object has no attribute shape 报错
5.
Python3报错AttributeError: 'dict' object has no attribute 'iteritems'
6.
【yaml】报错【AttributeError: 'str' object has no attribute 'get'】
7.
报错:AttributeError: 'NoneType' object has no attribute 'append'
8.
Python报错: 'function' object has no attribute '_name_'
9.
Python报错:AttributeError: 'RACNN' object has no attribute 'module'
10.
报错 AttributeError: 'module' object has no attribute 'bool_'
更多相关文章...
•
MySQL外键约束(FOREIGN KEY)
-
MySQL教程
•
ionic 列表操作
-
ionic 教程
•
RxJava操作符(六)Utility
•
RxJava操作符(四)Combining
相关标签/搜索
projects
attribute
foreignkey
作操
操作
object...object
object
错报
报错
时报
Python
Hibernate教程
MyBatis教程
Redis教程
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
eclipse设置粘贴字符串自动转义
2.
android客户端学习-启动模拟器异常Emulator: failed to initialize HAX: Invalid argument
3.
android.view.InflateException: class com.jpardogo.listbuddies.lib.views.ListBuddiesLayout问题
4.
MYSQL8.0数据库恢复 MYSQL8.0ibd数据恢复 MYSQL8.0恢复数据库
5.
你本是一个肉体,是什么驱使你前行【1】
6.
2018.04.30
7.
2018.04.30
8.
你本是一个肉体,是什么驱使你前行【3】
9.
你本是一个肉体,是什么驱使你前行【2】
10.
【资讯】LocalBitcoins达到每周交易比特币的7年低点
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
解决 AttributeError: 'ForeignKey' object has no attribute 're'
2.
AttributeError: ‘NoneType‘ object has no attribute ‘author‘(Django操作数据库时)
3.
GNURadio报错: AttributeError: ‘module‘ object has no attribute ‘channelizer‘
4.
attributeError: NoneType object has no attribute shape 报错
5.
Python3报错AttributeError: 'dict' object has no attribute 'iteritems'
6.
【yaml】报错【AttributeError: 'str' object has no attribute 'get'】
7.
报错:AttributeError: 'NoneType' object has no attribute 'append'
8.
Python报错: 'function' object has no attribute '_name_'
9.
Python报错:AttributeError: 'RACNN' object has no attribute 'module'
10.
报错 AttributeError: 'module' object has no attribute 'bool_'
>>更多相关文章<<