Вопрос

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