Create a hidden field in the admin site

前端 未结 5 772
孤街浪徒
孤街浪徒 2021-01-11 18:57

How can I create a fully hidden field (input and label) in the admin site? I know about the exclude property, but it fully excludes the field from the template,

5条回答
  •  爱一瞬间的悲伤
    2021-01-11 19:28

    In the template, while displaying

    {% for field in form.visible_fields %}
        {{ field.label_tag }} : {{ field }}
    {% endfor %}
    

    It will hide the hidden field labels.

提交回复
热议问题