How to show all fields of model in admin page?

后端 未结 11 515
無奈伤痛
無奈伤痛 2021-01-30 16:25

here is the models page

In this picture, only the title shows up on here, I used:

 def __unicode__(self):
        return self.title;  

11条回答
  •  孤独总比滥情好
    2021-01-30 16:54

    Many of the answers are broken by Django 1.10. For version 1.10 or above, this should be

    list_display = [f.name for f in Book._meta.get_fields()]
    

    Docs

提交回复
热议问题