如何添加类标签ul CheckboxSelectMultiple django

时间:2017-03-13 08:47:06

标签: html django django-forms django-templates

我的表格

'warranty': forms.CheckboxSelectMultiple(attrs={'class': 'list-inline'}),

我的模板

<div class="col-md-12" style="height: 50px;  width: 900px;">
   <label class="list-inline col-xs-6" for="{{form2.warranty.name}}" style="width: 140px; padding-right: 20px;padding-left: 20px;">{{ form2.warranty.label }}</label>
   {{ form2.warranty}}
</div>

结果

<ul id=id_class>
  <li class="list-inline id="id_warranty_1" name="warranty">opcion 1</li>
  <li class="list-inline id="id_warranty_2" name="warranty">opcion 2</li>
  <li class="list-inline id="id_warranty_3" name="warranty">opcion 3</li>
</ul>

但我需要

上的课程列表
<ul class="MYCLASS" id=id_class>
  <li class="list-inline id="id_warranty_1" name="warranty">opcion 1</li>
  <li class="list-inline id="id_warranty_2" name="warranty">opcion 2</li>
  <li class="list-inline id="id_warranty_3" name="warranty">opcion 3</li>
</ul>

问题实际

Current unwanted result

期望的结果

desired result

0 个答案:

没有答案