I have a simple form:
class SubmissionQuickReplyForm(forms.Form):
comment_text = forms.CharField(label=\'\', required=False, widget=forms.Textarea(attrs={\'r
For ChoiceField you can use
choice = forms.ChoiceField(choices=[
(choice.pk, choice) for choice in MyChoices.objects.all()])
You can use ModelChoiceField instead.
choice = forms.ModelChoiceField(queryset=MyChoices.objects.all())
And you can get by simply call cleaned_data
like this.
if request.method == "POST":
form = SubmissionQuickReplyForm(request.POST)
if form.is_valid():
ch = form.cleaned_data.get('choice')