Django Models Radio Input
问题 I am trying to incorporate radio buttons in my form. In my forms.py I have the following fields for the form : class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['first_name', 'last_name', 'gender'] In my models.py : user = models.ForeignKey(User, db_column='user_id') first_name = models.CharField(max_length=250) last_name = models.CharField(max_length=250 GENDER = (('M', 'Male'), ('F', 'Female'), ('O', 'Other')) gender = models.CharField(max_length=1, choices=GENDER,