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.
vs2019運行opencv圖片顯示代碼時,窗口亂碼
2.
app自動化 - 元素定位不到?別慌,看完你就能解決
3.
在Win8下用cisco ××× Client連接時報Reason 422錯誤的解決方法
4.
eclipse快速補全代碼
5.
Eclipse中Java/Html/Css/Jsp/JavaScript等代碼的格式化
6.
idea+spring boot +mabitys(wanglezapin)+mysql (1)
7.
勒索病毒發生變種 新文件名將帶有「.UIWIX」後綴
8.
【原創】Python 源文件編碼解讀
9.
iOS9企業部署分發問題深入瞭解與解決
10.
安裝pytorch報錯CondaHTTPError:******
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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_'
>>更多相關文章<<