Hi, I have this problem ... I can not manage to display the radio button in the template ... in which I'm wrong?
models.py
class Genero(models.Model):
MASCULINO ='mas'
FEMENINO ='fem'
Type_CHOICES = (
(MASCULINO,'masculino'),
(FEMENINO,'femenino'))
sexo = models.CharField(choices=Type_CHOICES,default=MASCULINO, max_length=100)
form.py
class VideoForm(forms.ModelForm):
class Meta:
model=Genero
fields=['sexo']
widgets = {
'sexo': forms.RadioSelect(choices=Video.Type_CHOICES)
}
template
{% for radio in sexo %}
<label >
{{ radio }}
<span> {{ radio.tag }} </span>
</label>
{% endfor %}