How to hide some fields in django-admin?

后端 未结 4 1996
猫巷女王i
猫巷女王i 2021-02-01 00:43
class Book(models.Model):
    title = models.CharField(..., null=True)
    type = models.CharField(...)
    author = models.CharField(...)

I have a sim

4条回答
  •  不思量自难忘°
    2021-02-01 01:09

    Apropos @Lorenz @mrts answer

    with Django 2.1 I found that exclude does not work if the field is already specified via fields = .

    In that case you may use

    self.fields.remove('title')
    

    fields will have to be defined as a list [] for this to work

提交回复
热议问题