是否可以检索纯字段标签。
当我使用类似 {{ form.field.label }}
的内容时,它包含 html 标签
元素。
我只是想在某些地方使用疼痛标签。
最佳答案
我没有在这里测试的工具,但我认为您可能正在搜索的是:
{{ form.field.label.text }}
参见the relevant section from the documentation :
field_id
The ID of the field which this label will reference.
text
The original label text passed to the field’s constructor.
关于python - 检索纯字段标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15426784/