python - How to have a multiple select field in django in the form of a drop down box -


Any help is greatly appreciated, I'm a newbie in the DJ.

  class studentRegister (forms.Form): courseList = forms.ModelMultipleChoiceField (queryset = course.officeSoul ())   

Thank you and appreciate your time , I just want to modify this type of form so that I can choose two or more options at one time and return it to the list?

I think you can use the SelectMultiple widget. class studentRegister (forms.Form): course list = forms.ModelMultipleChoiceField (queryset = course.objects.all), widget = form. Select multiple)

If it does not meet your needs, then you can try to use it.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -