您好,登錄后才能下訂單哦!
初學(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,
修改list_display中的account_admin,password_admin 即可解決,其實(shí)報(bào)錯(cuò)中的信息已經(jīng)很明確了。
免責(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)容。