How to let user be multiple-choice in Django models? Do I need django-multiselectfield, but it's choices are user-defined, right?(sample 1), not the data from user models. I want to make multiple-choice users, not single choice, I pasted my code as below, Thanks in advance.
Asked
Active
Viewed 414 times
0
-
`ManyToManyField ` class id by default using multiple select form. could you post your form model and the view? – Edwin Lunando Apr 18 '18 at 05:25
-
Thank you for reading my code, I already add forms.py and views.py, now I received a error of "django.core.exceptions.FieldError: Invalid field name(s) given in select_related: 'skill'. Choices are: department, teacher ", I don't know where the problem is.......... – Elsa Apr 18 '18 at 07:10
-
This is what you need to do in your ModelForm https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/#overriding-the-default-fields – rtindru Apr 18 '18 at 09:14
-
It strange, you already use `CheckboxSelectMultiple ` widget but in the HTML it shows select box, could you post your template file? – Edwin Lunando Apr 18 '18 at 12:54