当用户创建新对象时,我想隐藏字段名,但是如果用户想编辑这个对象,它必须是可见的。我尝试了排除方法,但是当我试图编辑这个字段时,它使字段不可见。例如,我想隐藏状态字段。 name = models.CharField(max_length=255) price = models.CharField(max_length=255)
status = models.BooleanFiel
%} <div class="js-hide-edit-field {% if check_in_type and not form.min_weeks.value %}hide{% endif %}">
{{ form.min_weeks|add_error_class:"invalid"|attr:"data-duration-weeks-mask" }<a h