﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31820	CheckboxSelectMultiple widget doesn't work with TextChoices enabled CharFields	Remy	nobody	"
# forms.py
{{{

class MovieForm(forms.ModelForm):

    class Meta:
        model = Movie
        fields = [
            'genres',
        ]
        widgets = {
            'genres': forms.CheckboxSelectMultiple
        }
}}}

# models.py
{{{
class Movie(models.Model):
    class Genre(models.TextChoices):
        SCIFI = 'S', 'Science Fiction'
        ACTION = 'A', 'Action'

    genres = models.CharField(max_length=1, choices=Genre.choices)
}}}

# template
{{{
{{ form.genres.errors }}
}}}

Select one checkbox for example, then post the form. On `form.save()`, the following error is returned to the template:
{{{
""Select a valid choice. ['S'] is not one of the available choices.""
}}}


"	Bug	closed	Forms	3.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
