yjwong edited a comment on issue #13985:
URL: https://github.com/apache/airflow/issues/13985#issuecomment-773795228


   Flask-AppBuilder also runs validations for every field when it's submitted. 
I was not able to find a way to conditionally add/remove fields depending on 
the submitted `conn_type`, so that means that my PR alone would not work.
   
   However, it's possible for a provider to get it to work using a validator 
that's conditional on the `conn_type`:
   
   ```python
   class InputRequired(wtforms.validators.InputRequired):
       field_flags = ('required', )
   
       def __call__(self, form, field):
           conn_type = form.conn_type.data
           if conn_type == MyHook.conn_type:
               super().__call__(form, field)
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to