wtform_extensions module - Platform - BlueCat Gateway - 24.1

Gateway Administration Guide

Product name
BlueCat Gateway

WTForm extensions for form templates and useful functions.

class bluecat.wtform_extensions.GatewayForm(*args, **kwargs)

Bases: flask_wtf.form.FlaskForm

Custom Form for generating DNS Gateway Workflows.


Generates JavaScript for re-enabling disabled fields upon reloading the same workflow with an error.

Returns: HTML script snippet with generated JavaScript.

class bluecat.wtform_extensions.NoPreValidationSelectField(*args, **kwargs)

Bases: wtforms.fields.choices.SelectField

SelectField with no pre-validation of field value against possible choices. Useful if choices are dynamically populated.


Pre-validate method being overwritten to no longer perform validation.

bluecat.wtform_extensions.validate_element_in_tuple(index_of_value_to_validate, validator)

Use when you have a field such as a SelectField that has a choices attribute with a list of tuples. If you have an element in the tuple that needs to be validated but it is not the first element of the tuple.

Parameters Description

The index of the element in the tuple that should be validated. Only the element with the specified index in the tuple will be validated.


The validator function to use when validating the value at the given index of the tuple.