[Answered ]-How can i get a value from forms.ModelChoiceField in django?

2πŸ‘

βœ…

The same way as with any other field.

The problem is that you have defined a form class, but you are not using it in any way at all. Instead of ignoring the form and getting data from request.POST, you should be instantiating the form with the POST data, calling is_valid() on it, then getting the result from form.cleaned_data.

Leave a comment