[Answer]-Django blank select field

1👍

For the ------- option just make it an optional field with required=False and to start with no choices use an empty queryset with Piece.objects.none():

class ProjectInfoForm(forms.Form):
    module = forms.ModelChoiceField(
        queryset=Module.objects.all(),
    )
    piece = forms.ModelChoiceField(
        queryset=Piece.objects.none(),
        required=False,
    )
👤mVChr

Leave a comment