Thank you, Tom. You are right! I shouldn't assign choices to a
ModelMultipleChoiceField. That's what caused the problem. But instead of
constructing a custom ModelMultipleChoiceField subclass, I abandoned "Model
Form" and simply did the following, which worked!
class myForm(forms.Form):
On Wed, Aug 3, 2011 at 4:57 AM, sasa1...@gmail.com wrote:
> Thank you, DR. But I tried that before and it did not work for some reason.
> It basically skips "if Answer.is_valid():" and goes to "else".
>
> voss
>
I think this is because you are abusing your model form, and
Thank you, DR. But I tried that before and it did not work for some
reason. It basically skips "if Answer.is_valid():" and goes to "else".
voss
You've defined your form to expect a `request` argument, but then you
haven't passed that argument.
answer = MyForm(request, request.GET or
On Tuesday, 2 August 2011 19:15:12 UTC+1, voss wrote:
>
> Hello all,
>
> I have a dynamic form as follows:
>
> class myForm(forms.Form):
> Question =
> forms.ModelMultipleChoiceField(queryset=Model.objects.none(),
> widget=forms.RadioSelect())
> def __init__(self, request, *args,
Hello all,
I have a dynamic form as follows:
class myForm(forms.Form):
Question = forms.ModelMultipleChoiceField(queryset=Model.objects.none(),
widget=forms.RadioSelect())
def __init__(self, request, *args, **kwargs):
super(myForm, self).__init__(*args, **kwargs)
5 matches
Mail list logo