我正在编写models.py 文件,我需要一些控件来执行某些字段的自动编译。
MOTIVOINGRESSO = (
(u'sequestro ', u'sequestro'),
(u'fermo ', u'fermo'),
(u'confisca final ', u'confisca final'),
(u'cambio custodian ', u'cambio custodian'),
)
motivo_ingresso = models.CharField (max_length = 50, choices = MOTIVOINGRESSO)
FERMO = (
(u'30 ', u'30'),
(u'60 ', u'60'),
(u'90 ', u'90'),
(u'180 ', u'180'),
(u'1 month ', u'1 month'),
(u'3 months, 'u'3 months'),
(u'indeterminato ', u'indeterminato'),
)
durata_in_giorni_del_fermo = models.CharField (max_length = 20, choices = STOPPED, blank = True)
如果管理员选择点击' sequestro ',在里面durata_in_giorni_del_fermo
会自动选择' indeterminato '。我应该报告输入的值吗?或机器周期,如果在模型内?
有任何想法吗?