Suppose I have a model:
class SomeModel(models.Model):
id = models.AutoField(primary_key=True)
a = models.CharField(max_length=10)
b = models.CharField(max_length=7)
Currently I am using the default admin to create/edit objects of this type.
How do I remove the field b
from the admin so that each object cannot be created with a value, and rather will receive a default value of 0000000
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…