如果我有一個models.IntegerField一些組合的選擇,我怎麼能默認值設置爲這些選擇的組合如何設置的默認值分組選擇在Django
例如:
class ForumThread():
STATE_CHOICES = (
('Sticky', (
(True, 'True'),
(False, 'False') ) ),
('Blocked', (
(False, 'False')
(True, 'True') ) ),
)
name = models.CharField(max_length= 256)
description = models.CharField(max_length= 256)
state = models.IntegerField(choices= STATE_CHOICES)
該類我要爲「國家」字段默認值設置爲阻止 - >虛假和粘性 - >假
感謝