避免在django crispy表单中显示帮助_文本
我正在使用避免在django crispy表单中显示帮助_文本,django,django-registration,django-crispy-forms,Django,Django Registration,Django Crispy Forms,我正在使用django crispy forms从django registration redux定制RegistrationForm。为此,我定义了一个工作正常的FormHelper: class MyRegistrationForm(RegistrationForm): def __init__(self, *args, **kwargs): super(MyRegistrationForm, self).__init__(*args, **kwargs)
django crispy forms
从django registration redux
定制RegistrationForm
。为此,我定义了一个工作正常的FormHelper
:
class MyRegistrationForm(RegistrationForm):
def __init__(self, *args, **kwargs):
super(MyRegistrationForm, self).__init__(*args, **kwargs)
helper = self.helper = FormHelper()
# Moving field labels into placeholders
layout = helper.layout = Layout()
for field_name, field in self.fields.items():
layout.append(Field(field_name, placeholder=field.label))
helper.template_pack = 'bootstrap3'
helper.form_show_labels = False
我的表单显示为我想要的:没有标签、bootstrap3和从标签派生的占位符
现在,我还想抑制help_文本,它来自定义。有一个以某种方式相关的标志(help\u text\u inline
),但它并不用于禁用帮助文本的显示。在FormHelper
中,我找不到完全禁用帮助文本显示的标志。这有可能吗
从
字段
定义中删除帮助文本实际上不是一个选项,因为我继承了注册表单
,不想对其进行太多修改。签出此答案。太好了,谢谢,我不能接受你的评论检查这个答案。太好了,谢谢,我不能接受你的评论