我的模型结构如下:
class Store(models.Model):
STORE_TYPE = (
('I', 'Ice Cream'),
('H', 'Hardware'),
)
retailer_type = models.CharField(max_length=10, choices=STORE_TYPE)
...
class HardwareStore(Store):
hammers_stocked = models.BooleanField()
当我创建 HardwareStore() 对象时,我想将 Retailer_type 默认设置为 H。是否可以在 HardwareStore 类中为此字段设置默认值?