gpt4 book ai didi

django - django 多个 MultipleChoiceField 旁边的项目符号

转载 作者:行者123 更新时间:2023-12-03 01:43:31 24 4
gpt4 key购买 nike

我有一个包含 2 个 MultipleChoiceField 和 CheckboxSelectMultiple 小部件的表单。

在模板中呈现时,复选框在每个选项的左侧都有一个“要点”。

我认为这与呈现为的复选框有关,但我不确定如何删除项目符号点?

非常感谢您的反馈。

表单

class GameScheduleForm(forms.Form):

weight_training_days = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple,
choices=(
(0, "MONDAY"),
(1, "TUESDAY"),
(2, "WEDNESDAY"),
(3, "THURSDAY"),
(4, "FRIDAY"),
(5, "SATURDAY"),
(6, "SUNDAY"),
),
)

cardio_training_days = forms.ChoiceField(widget=forms.CheckboxSelectMultiple,
choices=(
(0, "MONDAY"),
(1, "TUESDAY"),
(2, "WEDNESDAY"),
(3, "THURSDAY"),
(4, "FRIDAY"),
(5, "SATURDAY"),
(6, "SUNDAY"),
),
)

模板

{% extends "fitgames/fitgames_base.html" %}

{% block content %}
<div class="row-fluid">
<div class="well game span4 offset4">
<div class="row-fluid">
<h4 class="text-center">Total Body HIT</h4>
<p class="text-center">Select the days you can workout</p>
</div>
<div class="row-fluid">
<form method="post" action="{% url 'game_setup2_schedule' %}"> {% csrf_token %}
<div><strong>Select 3 Weight Training Days</strong></div>
<div>{{ form.weight_training_days}}</div>
<div><strong>Select 3 Cardio Days</strong></div>
<div>{{ form.cardio_training_days }}</div>
<div><button class="btn btn-primary btn-large" type="submit">&nbsp;Next</button></div>
</form>
</div>
</div>
</div>

{% 结束 block %}

最佳答案

当 forms.CheckboxSelectMultiple 被渲染时,它被渲染在 ul 标签中。您需要做的是将以下内容添加到您的 CSS 中(使其根据需要更具体地针对该表单):

ul
{
list-style-type: none;
}

关于django - django 多个 MultipleChoiceField 旁边的项目符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21271327/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com