I have the following code:
category = forms.ModelMultipleChoiceField( label="Category", queryset=Category.objects.order_by('name'), widget=forms.Select( attrs={ 'placeholder': 'Product Category', 'class': 'form-control'}), required=True )
how to set the initial value in the selection field, for example, "Select a category", so that the selection field has a list of categories with the initial value "Select a category"
django django-forms
Jasmine
source share