(admin.E108) The value of 'list_display[0]' refers to ' studentId', which is not a callable, an attribute of 'StudentsAdmin', or an attribute or method on 'students.Students'. <class 'students.admin.StudentsAdmin'>: (admin.E108) The value of 'list_display[5]' refers to ' zhuanye', which is not a callable, an attribute of 'StudentsAdmin', or an attribute or method on 'students.Students'.

models,和admin下的注冊(cè)問題

在models定義的屬性,在admin的list_display中顯示出來,報(bào)的錯(cuò)誤


提示錯(cuò)誤

實(shí)際是自己的list_display格式錯(cuò)誤,檢查發(fā)現(xiàn)

class StudentsAdmin(admin.ModelAdmin):

list_display = [' studentId', 'studentName', 'password', 'gender',? 'institute', ' zhuanye']

是第一個(gè)和最后一個(gè)在復(fù)制的時(shí)候多加了一個(gè)空格。

!!!刪掉空格即可。python的格式真的很嚴(yán)格

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容