当我尝试从Django管理界面中删除“ str”对象时,无法调用该对象?

时间:2019-12-11 06:50:18

标签: django python-3.x django-models

当我尝试从Django管理面板删除对象时出现此错误:

TypeError at /admin/carts/cart/21/delete/
'str' object is not callable
Request Method: GET
Request URL:    http://localhost:8000/admin/carts/cart/21/delete/
Django Version: 2.2.6
Exception Type: TypeError
Exception Value:    
'str' object is not callable
Exception Location: C:\Users\HP\spippt\ppt\lib\site-packages\django\db\models\deletion.py in collect, line 224
Python Executable:  C:\Users\HP\spippt\ppt\Scripts\python.exe
Python Version: 3.7.0
Python Path:    
['C:\\Users\\HP\\spippt\\ppt\\myproject',
 'C:\\Users\\HP\\spippt\\ppt\\Scripts\\python37.zip',
 'C:\\Users\\HP\\spippt\\ppt\\DLLs',
 'C:\\Users\\HP\\spippt\\ppt\\lib',
 'C:\\Users\\HP\\spippt\\ppt\\Scripts',
 'C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib',
 'C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
 'C:\\Users\\HP\\spippt\\ppt',
 'C:\\Users\\HP\\spippt\\ppt\\lib\\site-packages']
Server time:    Wed, 11 Dec 2019 12:14:29 +0530

0 个答案:

没有答案