1👍
✅
You can use the MultipleChoiceField
in Django. https://docs.djangoproject.com/en/1.10/ref/forms/fields/#multiplechoicefield
If the choices that the user can select are coming from a model then you can use the ModelMultipleChoiceField
and pass a queryset for the choices. check https://docs.djangoproject.com/en/1.10/ref/forms/fields/#modelmultiplechoicefield
👤nael
0👍
Use the django widgets
CHOICES=[('Italian','Italian'),
('Mexican','Mexican')]
like = forms.ChoiceField(choices=CHOICES, widget=forms.Select())
- Circular import between models and helpers in Django
- How serialize count() from sql query to JSON
- How To Structure Table In Django With Overlapping Items
- Django NoReverseMatch exception in django template
- Submitting all forms on a page with JavaScript using ajax at once to Django
Source:stackexchange.com