Django-属性的标签不正确

Django-属性的标签不正确,django,django-forms,Django,Django Forms,我们正在使用Django 1.4.3创建我们的网站。我有两个表单具有相同的位置选择(国家、地区和城市),因此我使用 country_id = forms.ChoiceField(choices=COUNTRY_CHOICES, required=False, label=u'Country', widget=forms.Select(attrs={'id': 'id_select_country_id'})) 表单有标签,但当我使用验证HTML时,出现以下错误: The for attribu

我们正在使用Django 1.4.3创建我们的网站。我有两个表单具有相同的位置选择(国家、地区和城市),因此我使用

country_id = forms.ChoiceField(choices=COUNTRY_CHOICES, required=False, label=u'Country', widget=forms.Select(attrs={'id': 'id_select_country_id'}))
表单有标签,但当我使用验证HTML时,出现以下错误:

The for attribute of the label element must refer to a form control.
<label class="control-label" for="id_settings-country_id">Country</label>
<select id="id_select_country_id" name="settings-country_id">
....
我们使用django引导工具包2.15.0版来呈现表单

{{ settings_form|as_bootstrap:"horizontal" }}