溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Django:The value of 'list_display[3]' refers to 'account_admin', which is not a call

發(fā)布時(shí)間:2020-06-24 21:45:55 來(lái)源:網(wǎng)絡(luò) 閱讀:2340 作者:Amnesiasun 欄目:數(shù)據(jù)庫(kù)

初學(xué)Django,Django 修改models.py 字段后執(zhí)行makemigrations報(bào)錯(cuò),報(bào)錯(cuò)信息:

<class 'test2.admin.AccountAdmin'>: (admin.E108) The value of 'list_display[3]' refers to 'account_admin', which is not a callable, an attribute of 'AccountAdmin', or an attribute or method on 'test2.Account'.
<class 'test2.admin.AccountAdmin'>: (admin.E108) The value of 'list_display[4]' refers to 'password_admin', which is not a callable, an attribute of 'AccountAdmin', or an attribute or method on 'test2.Account'.

第一遇到有點(diǎn)手足無(wú)措,搜索了一波,在這里找到了答案。

原來(lái)是我在admin.py中定義了AccountAdmin,

Django:The value of 'list_display[3]' refers to 'account_admin', which is not a call

修改list_display中的account_admin,password_admin 即可解決,其實(shí)報(bào)錯(cuò)中的信息已經(jīng)很明確了。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI