0
我摆弄Django窗体和Django Crispy Forms(使用Bootstrap作为我的主题)。我定义了两个领域:Django BooleanField不显示标签
test1 = forms.BooleanField(label='Some label here', help_text='help text here')
和
test2 = forms.CharField(label='another label', help_text='more help text')
当我使我的形式,在test2的现场节目,如标签:
another label: <input box>
与 '更多的帮助文本' 的下方。
然而,对于TEST1(BooleanField),标签似乎改变文本框后显示的值,即
[] 'Some label here'
help text here
有没有一种方法,使之显示更加喜欢:
Some label here []
help text here
谢谢!
这就是你在找什么:http://stackoverflow.com/a/2045308/1628832 – karthikr
我看了这个例子,但我不知道如何使它与Crispy Forms一起工作,因为我的模板只是包含以下内容:{%block content%} {%crispy form%} {%endblock%} – user2406467