Re: django widget radio button error save is not touch

2020-09-07 Thread José Luis Ruiz
Build your class like this one: class Card(models.Model): class Suit(models.IntegerChoices): DIAMOND = 1 SPADE = 2 HEART = 3 CLUB = 4 suit = models.IntegerField(choices=Suit.choices) https://docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.Field.choices Look at

django widget radio button error save is not touch

2020-09-06 Thread carlos
Hi, i have a problem when save a field in radio button in my models have this CHOICES_OPTIONS = ( (1, 'Yes'), (2, 'No'), ) class MyModels(...): myfield = models.IntegerField(choices=CHOICES_OPTIONS, null=True, blank=True) class MyModelsForm() myfield = forms.ChoiceField(widget=form