hello .
im new to django and
i want to create a form that looks like the image above in html.
the form should save the data when the user chose a radio button.
how to implement such a form in django ( please note that user cannot chose more than one answer)
You want to use ChoiceField and RadioSelect:
Remember, Django documentation is your friend!
Dynamically Changing Choices
If you want to be able to dynamically create the form, it might be a good idea to use ModelForm instead of forms.Form. Here’s an example:
In your view instantiate the form with an instance specified to use:
The form will then use the answers associated with that Question (in this case randomly chosen) and pass the form to the templates context as usual.