私のモデルフォーム:
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 つのフィールドをフィールド リストに追加できません。私のオプションは何ですか?