Open Greg83480 opened 2 years ago
Had the same issue, setting the choices list on the ChoiceField rather than on the Select widget solved the issue for me (though I cannot figure how to apply style to the created widget)
So your code would look something like this:
category = forms.ChoiceField(choices=choice_list, widget=forms.Select(attrs={'class': 'form-select'}))
Hope this helps!
@Greg83480 Is your issue solved? Been a while since this ticket was created 😅
Hello,
I'am using this form class to populate an dropdown list. My problem the dropdown is empty
class LeadModelForm(forms.ModelForm): class Meta: model = InstaProfile fields = fields = 'all' choices = Category.objects.all().values_list('name','name') choice_list = []
If a i remove the crispy filter on my html template file is working
Any idea ?
Thank you
Greg