How to change Django Admin Custom list field label

后端 未结 2 480
名媛妹妹
名媛妹妹 2021-02-11 14:54

How to change in_stock verbose_name ?

Models.py

class Book(models.Model):
 name = models.CharField(u\"Нэр\", max_length = 200)

 @property
 def in_stock(self):         


        
2条回答
  •  臣服心动
    2021-02-11 15:26

    change your model and verbose_name parametr to field. I change "author" label to "Author(s)"

    models.py

    class books(models.Model):
        title = models.CharField(max_length = 250)
        author= models.CharField(max_length = 250, verbose_name='Author(s)')
    

    or simply

    author      = models.CharField('Author(s)',max_length = 250)
    

提交回复
热议问题