[Answer]-Django form field is not displayed

1👍

Change the code to following:

 from house.models import COUNTRY_LIST, HOUSE_TYPES
 from profile.models import Region

 class SearchForm(forms.Form):
     def __init__(self, *args, **kwargs):
         super(SearchForm, self).__init__(*args, **kwargs)
         self.fields['countries'] = forms.ChoiceField(choices=COUNTRY_LIST, widget=forms.Select(attrs={'title': 'Страна','class': 'search-r-from-select style-select'}))
         self.fields['type'] = forms.ChoiceField(choices=HOUSE_TYPES, widget=forms.Select(attrs={'class': 'search-r-from-select style-select'}))

Leave a comment