title: Flask-WTForms: how to check if a field is required?
body: <p>I defined a form in the following way:</p>
  
  <pre><code>class LoginForm(Form):
      login = EmailField(u'Email address', [required(), length(min=5, max=2048), validators.Email()])
      password = PasswordField(u'Password', [required(), length(min=6, max=50)])
      next = HiddenField()
      remember = BooleanField('Remember me')
      submit = SubmitField('Login')
  </code></pre>
  
  <p>Then I'm writing a generic macro in Jinja2 to render the form fields and I would like to do something like:</p>
  
  <pre><code>{% if field.is_required() %}
    {{ field.label(class_='required') }}
  {% else %}
    {{ field.label() }}
  {% endif %}
  </code></pre>
  
  <p>So... is there a way to see if a field is required? </p>