문제

What is the cleanest way to confirm if a field is visible with WTForms?

I have a jinja macro which renders form fields, and it simply needs to skip rendering labels for hidden fields.

도움이 되었습니까?

해결책

I just did some playing around and reached this conclusion:

{% if field.widget.input_type != 'hidden' %
    {{ field.label }}
{% endif %}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top