我的模型形式:
class CustomerBillingForm(ModelForm):
expiration_month = models.IntegerField(choices=(1,2,3,4,5,6,7,8,9,10,11,12))
expiration_year = models.IntegerField(max_length=4)
card_number = models.IntegerField(max_length=16)
card_cvv = models.IntegerField(max_length=4)
class Meta:
model = Customer
fields = ['billing_first_name', 'billing_last_name', 'billing_address',
'billing_address_2', 'billing_city', 'billing_state',
'billing_zip', 'billing_country']
当我在模板中使用此表单时,我没有得到 4 个自定义字段,只有“字段”列表中的那些。我无法将前 4 个字段添加到字段列表中。我有哪些选择?