I have these models:
CURSES=(('python','Python'),('django','Django'),...)
class Asig(models.Model):
...
name = models.CharField(max_length=100, choices=CURSES)
class Profesor(AbstractUser):
...
asigs = models.ManyToManyField(Asig)
Then, when I render the form using ModelForm, the many-to-many field shows itself with the string 'python' instead of 'Python', also when I look at the rendered html code, the multiselect parameters look like this:
<option value='1'>python</option>
instead
<option value='python'>Python</option>
source
share