Beispiel #1
0
    def pre_add_get(self, docker=None):

        self.add_form_extra_fields['describe'] = StringField(
            _(self.datamodel.obj.lab('describe')),
            default='',
            description="目标环境描述",
            widget=BS3TextFieldWidget(),
            validators=[DataRequired()])

        self.add_form_extra_fields['target_image'] = StringField(
            _(self.datamodel.obj.lab('target_image')),
            default=conf.get('REPOSITORY_ORG') + g.user.username + ":xx",
            description="目标镜像名,必须为%s%s:xxx" %
            (conf.get('REPOSITORY_ORG'), g.user.username),
            widget=BS3TextFieldWidget(),
            validators=[
                DataRequired(),
                Regexp("^%s%s:" %
                       (conf.get('REPOSITORY_ORG'), g.user.username))
            ])

        self.add_form_extra_fields['base_image'] = StringField(
            _(self.datamodel.obj.lab('base_image')),
            default='',
            description=Markup(f'基础镜像和构建方法可参考:<a href="%s">点击打开</a>' %
                               (conf.get('HELP_URL').get('docker', ''))),
            widget=BS3TextFieldWidget())
        # # if g.user.is_admin():
        # self.edit_columns=['describe','base_image','target_image','need_gpu','consecutive_build']
        self.edit_form_extra_fields = self.add_form_extra_fields
Beispiel #2
0
class RegForm(DynamicForm):

    first_name = StringField(u'First Name',
                             validators=[input_required()],
                             widget=BS3TextFieldWidget())

    last_name = StringField(u'Last Name',
                            validators=[input_required()],
                            widget=BS3TextFieldWidget())
    aadhaar = StringField(
        u'Aadhaar',
        [input_required(), length(min == 12),
         length(max=12)],
        widget=BS3TextFieldWidget())
    gender = SelectField('Gender',
                         choices=[('M', 'Male'), ('F', 'Female'),
                                  ('T', 'Transgender')])
    dob = DateField("Date of Birth",
                    format='%Y-%m-%d',
                    validators=[input_required()])
    email = StringField("Email",
                        validators=[DataRequired(),
                                    validators.Email()],
                        widget=BS3TextFieldWidget())
    number = IntegerField('Mobile',
                          validators=[DataRequired([DataRequired()])])
    password = PasswordField(
        ' Password',
        [DataRequired(),
         EqualTo('confirm', message='Passwords must match')])
    confirm = PasswordField('Repeat Password')
    accept_tos = BooleanField('I Agree', [DataRequired()])
    submit = SubmitField("Register")
Beispiel #3
0
    def get_connection_form_widgets() -> dict:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from wtforms import StringField, SelectField, BooleanField, PasswordField
        from ewah.ewah_utils.widgets import EWAHTextAreaWidget

        return {
            "extra__ewah_mongodb__conn_style":
            SelectField(
                "Connection Style",
                choices=[("uri", "URI"), ("credentials", "Credentials")],
            ),
            "extra__ewah_mongodb__tls":
            BooleanField("SSL / TLS?"),
            "extra__ewah_mongodb__tls_insecure":
            BooleanField("TLS: Allow insecure connections? Aka 'tlsInseure'"),
            "extra__ewah_mongodb__ssl_cert":
            StringField(
                "SSL Certificate",
                widget=EWAHTextAreaWidget(rows=12),
            ),
            "extra__ewah_mongodb__ssl_private":
            StringField(
                "SSL Private Key",
                widget=EWAHTextAreaWidget(rows=12),
            ),
            "extra__ewah_mongodb__ssl_password":
            PasswordField("SSL Certificate / Private Key Password", ),
            "extra__ewah_mongodb__auth_source":
            StringField("Auth Source", widget=BS3TextFieldWidget()),
            "extra__ewah_mongodb__auth_mechanism":
            StringField("Auth Mechanism", widget=BS3TextFieldWidget()),
            "extra__ewah_mongodb__ssh_conn_id":
            StringField("SSH Connection ID", widget=BS3TextFieldWidget()),
        }
class CustomRegistration(DynamicForm):

    # Get username for User, required
    username = StringField(_('User Name'),
                           validators=[DataRequired()],
                           widget=BS3TextFieldWidget())

    # Get email for activation, required
    email = StringField(_('Email'),
                        validators=[DataRequired(),
                                    Email()],
                        widget=BS3TextFieldWidget())

    # Get password for user, required
    password = PasswordField(
        _('Password'),
        description=_('Please use a good password policy, this application does not check this for you'),
        validators=[
            DataRequired()],
        widget=BS3PasswordFieldWidget())

    # Confirm password, required
    conf_password = PasswordField(
        _('Confirm Password'),
        description=_('Please rewrite the password to confirm'),
        validators=[
            EqualTo(
                'password',
                message=_('Passwords must match'))],
        widget=BS3PasswordFieldWidget())
Beispiel #5
0
class DagRunForm(DynamicForm):
    """Form for editing and adding DAG Run"""

    dag_id = StringField(lazy_gettext('Dag Id'),
                         validators=[DataRequired()],
                         widget=BS3TextFieldWidget())
    start_date = DateTimeWithTimezoneField(
        lazy_gettext('Start Date'), widget=AirflowDateTimePickerWidget())
    end_date = DateTimeWithTimezoneField(lazy_gettext('End Date'),
                                         widget=AirflowDateTimePickerWidget())
    run_id = StringField(lazy_gettext('Run Id'),
                         validators=[DataRequired()],
                         widget=BS3TextFieldWidget())
    state = SelectField(
        lazy_gettext('State'),
        choices=(
            ('success', 'success'),
            ('running', 'running'),
            ('failed', 'failed'),
        ),
        widget=Select2Widget(),
    )
    execution_date = DateTimeWithTimezoneField(
        lazy_gettext('Execution Date'), widget=AirflowDateTimePickerWidget())
    external_trigger = BooleanField(lazy_gettext('External Trigger'))
    conf = TextAreaField(lazy_gettext('Conf'),
                         validators=[ValidJson(), Optional()],
                         widget=BS3TextAreaFieldWidget())

    def populate_obj(self, item):
        """Populates the attributes of the passed obj with data from the form’s fields."""
        super().populate_obj(item)  # pylint: disable=no-member
        item.run_type = DagRunType.from_run_id(item.run_id)
        if item.conf:
            item.conf = json.loads(item.conf)
Beispiel #6
0
class ConnectionForm(DynamicForm):
    conn_id = StringField(lazy_gettext('Conn Id'), widget=BS3TextFieldWidget())
    conn_type = SelectField(lazy_gettext('Conn Type'),
                            choices=models.Connection._types,
                            widget=Select2Widget())
    host = StringField(lazy_gettext('Host'), widget=BS3TextFieldWidget())
    schema = StringField(lazy_gettext('Schema'), widget=BS3TextFieldWidget())
    login = StringField(lazy_gettext('Login'), widget=BS3TextFieldWidget())
    password = PasswordField(lazy_gettext('Password'),
                             widget=BS3PasswordFieldWidget())
    port = IntegerField(lazy_gettext('Port'),
                        validators=[validators.Optional()],
                        widget=BS3TextFieldWidget())
    extra = TextAreaField(lazy_gettext('Extra'),
                          widget=BS3TextAreaFieldWidget())

    # Used to customized the form, the forms elements get rendered
    # and results are stored in the extra field as json. All of these
    # need to be prefixed with extra__ and then the conn_type ___ as in
    # extra__{conn_type}__name. You can also hide form elements and rename
    # others from the connection_form.js file
    extra__jdbc__drv_path = StringField(lazy_gettext('Driver Path'),
                                        widget=BS3TextFieldWidget())
    extra__jdbc__drv_clsname = StringField(lazy_gettext('Driver Class'),
                                           widget=BS3TextFieldWidget())
    extra__google_cloud_platform__project = StringField(
        lazy_gettext('Project Id'), widget=BS3TextFieldWidget())
    extra__google_cloud_platform__key_path = StringField(
        lazy_gettext('Keyfile Path'), widget=BS3TextFieldWidget())
    extra__google_cloud_platform__keyfile_dict = PasswordField(
        lazy_gettext('Keyfile JSON'), widget=BS3PasswordFieldWidget())
    extra__google_cloud_platform__scope = StringField(
        lazy_gettext('Scopes (comma separated)'), widget=BS3TextFieldWidget())
class Formulariooferta(FlaskForm):
    cliente = StringField('Cliente', render_kw={'readonly': "true"})
    producto = SelectField('Producto', render_kw={'readonly': "true"})
    descuento = FloatField('Descuento %',
                           render_kw={'readonly': 'true'},
                           validators=[DataRequired()],
                           default=0)
    precio = FloatField('Precio $',
                        render_kw={'readonly': 'true'},
                        validators=[DataRequired()],
                        default=0)
    cantidad_oferta = IntegerField('Cantidad disponible para la oferta',
                                   render_kw={'readonly': 'true'},
                                   validators=[DataRequired()],
                                   widget=BS3TextFieldWidget())
    cantidad = IntegerField('Cantidad',
                            render_kw={'type': "number"},
                            validators=[DataRequired()],
                            widget=BS3TextFieldWidget())
    total = FloatField('Total $',
                       render_kw={'readonly': 'true'},
                       validators=[DataRequired()],
                       default=0,
                       description=lazy_gettext("""Total Previo Impuestos"""))
    submit = SubmitField("Realizar Pedido",
                         render_kw={"onclick": "confirmacion(event)"})
    def get_connection_form_widgets():
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import (
            BS3TextFieldWidget,
            BS3PasswordFieldWidget,
        )
        from wtforms import StringField

        return {
            "extra__ewah_amazon_seller_central__aws_access_key_id": StringField(
                "AWS Access Key ID", widget=BS3TextFieldWidget()
            ),
            "extra__ewah_amazon_seller_central__aws_secret_access_key": StringField(
                "AWS Secret Access Key", widget=BS3PasswordFieldWidget()
            ),
            "extra__ewah_amazon_seller_central__aws_arn_role": StringField(
                "AWS ARN - Role", widget=BS3TextFieldWidget()
            ),
            "extra__ewah_amazon_seller_central__lwa_client_id": StringField(
                "LoginWithAmazon (LWA) Client ID", widget=BS3TextFieldWidget()
            ),
            "extra__ewah_amazon_seller_central__lwa_client_secret": StringField(
                "LoginWithAmazon (LWA) Client Secret", widget=BS3PasswordFieldWidget()
            ),
            "extra__ewah_amazon_seller_central__refresh_token": StringField(
                "Refresh Token", widget=BS3PasswordFieldWidget()
            ),
        }
Beispiel #9
0
class DagRunForm(DynamicForm):
    dag_id = StringField(lazy_gettext('Dag Id'),
                         validators=[validators.DataRequired()],
                         widget=BS3TextFieldWidget())
    start_date = DateTimeField(lazy_gettext('Start Date'),
                               widget=AirflowDateTimePickerWidget())
    end_date = DateTimeField(lazy_gettext('End Date'),
                             widget=AirflowDateTimePickerWidget())
    run_id = StringField(lazy_gettext('Run Id'),
                         validators=[validators.DataRequired()],
                         widget=BS3TextFieldWidget())
    state = SelectField(lazy_gettext('State'),
                        choices=(
                            ('success', 'success'),
                            ('running', 'running'),
                            ('failed', 'failed'),
                        ),
                        widget=Select2Widget())
    execution_date = DateTimeField(lazy_gettext('Execution Date'),
                                   widget=AirflowDateTimePickerWidget())
    external_trigger = BooleanField(lazy_gettext('External Trigger'))
    conf = TextAreaField(lazy_gettext('Conf'),
                         validators=[ValidJson(),
                                     validators.Optional()],
                         widget=BS3TextAreaFieldWidget())

    def populate_obj(self, item):
        # TODO: This is probably better done as a custom field type so we can
        # set TZ at parse time
        super().populate_obj(item)
        item.execution_date = timezone.make_aware(item.execution_date)
        if item.conf:
            item.conf = json.loads(item.conf)
Beispiel #10
0
class TestForm(DynamicForm):
    TestFieldOne = StringField(lazy_gettext('Test Field One'),
                               validators=[DataRequired()],
                               widget=BS3TextFieldWidget())
    TestFieldTwo = StringField(lazy_gettext('Test Field One'),
                               validators=[DataRequired()],
                               widget=BS3TextFieldWidget())
Beispiel #11
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import BooleanField, StringField

        return {
            "extra__kubernetes__in_cluster":
            BooleanField(lazy_gettext('In cluster configuration')),
            "extra__kubernetes__kube_config_path":
            StringField(lazy_gettext('Kube config path'),
                        widget=BS3TextFieldWidget()),
            "extra__kubernetes__kube_config":
            StringField(lazy_gettext('Kube config (JSON format)'),
                        widget=BS3TextFieldWidget()),
            "extra__kubernetes__namespace":
            StringField(lazy_gettext('Namespace'),
                        widget=BS3TextFieldWidget()),
            "extra__kubernetes__cluster_context":
            StringField(lazy_gettext('Cluster context'),
                        widget=BS3TextFieldWidget()),
            "extra__kubernetes__disable_verify_ssl":
            BooleanField(lazy_gettext('Disable SSL')),
            "extra__kubernetes__disable_tcp_keepalive":
            BooleanField(lazy_gettext('Disable TCP keepalive')),
        }
Beispiel #12
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget, BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import IntegerField, PasswordField, StringField
        from wtforms.validators import NumberRange

        return {
            "extra__google_cloud_platform__project":
            StringField(lazy_gettext('Project Id'),
                        widget=BS3TextFieldWidget()),
            "extra__google_cloud_platform__key_path":
            StringField(lazy_gettext('Keyfile Path'),
                        widget=BS3TextFieldWidget()),
            "extra__google_cloud_platform__keyfile_dict":
            PasswordField(lazy_gettext('Keyfile JSON'),
                          widget=BS3PasswordFieldWidget()),
            "extra__google_cloud_platform__scope":
            StringField(lazy_gettext('Scopes (comma separated)'),
                        widget=BS3TextFieldWidget()),
            "extra__google_cloud_platform__num_retries":
            IntegerField(
                lazy_gettext('Number of Retries'),
                validators=[NumberRange(min=0)],
                widget=BS3TextFieldWidget(),
                default=5,
            ),
        }
Beispiel #13
0
class DagRunForm(DynamicForm):
    dag_id = StringField(lazy_gettext('Dag Id'),
                         validators=[validators.DataRequired()],
                         widget=BS3TextFieldWidget())
    start_date = DateTimeWithTimezoneField(
        lazy_gettext('Start Date'), widget=AirflowDateTimePickerWidget())
    end_date = DateTimeWithTimezoneField(lazy_gettext('End Date'),
                                         widget=AirflowDateTimePickerWidget())
    run_id = StringField(lazy_gettext('Run Id'),
                         validators=[validators.DataRequired()],
                         widget=BS3TextFieldWidget())
    state = SelectField(lazy_gettext('State'),
                        choices=(
                            ('success', 'success'),
                            ('running', 'running'),
                            ('failed', 'failed'),
                        ),
                        widget=Select2Widget())
    execution_date = DateTimeWithTimezoneField(
        lazy_gettext('Execution Date'), widget=AirflowDateTimePickerWidget())
    external_trigger = BooleanField(lazy_gettext('External Trigger'))
    conf = TextAreaField(lazy_gettext('Conf'),
                         validators=[ValidJson(),
                                     validators.Optional()],
                         widget=BS3TextAreaFieldWidget())

    def populate_obj(self, item):
        super(DagRunForm, self).populate_obj(item)
        if item.conf:
            item.conf = json.loads(item.conf)
Beispiel #14
0
class MyForm(DynamicForm):
    field1 = StringField(('Field1'),
                         description=('Your field number one!'),
                         validators=[DataRequired()],
                         widget=BS3TextFieldWidget())
    field2 = StringField(('Field2'),
                         description=('Your field number two!'),
                         widget=BS3TextFieldWidget())
Beispiel #15
0
class SMSForm(DynamicForm):
    DIRECTION_INCOMING = 'I'
    DIRECTION_OUTGOING = 'O'

    DIRECTION_CHOICES = [(DIRECTION_INCOMING, "Incoming"),
                         (DIRECTION_OUTGOING, "Outgoing")]

    STATUS_SUCCESS = 'success'
    '''Outgoing STATUS types'''
    STATUS_WARNING = 'warning'
    STATUS_ERROR = 'error'
    STATUS_INFO = 'info'
    STATUS_ALERT = 'alert'
    STATUS_REMINDER = 'reminder'
    STATUS_LOGGER_RESPONSE = 'from_logger'
    STATUS_SYSTEM_ERROR = 'system_error'
    STATUS_PENDING = 'pending'
    '''Incoming STATUS types'''
    STATUS_MIXED = 'mixed'
    STATUS_PARSE_ERRROR = 'parse_error'
    STATUS_BAD_VALUE = 'bad_value'
    STATUS_INAPPLICABLE = 'inapplicable'
    STATUS_NOT_ALLOWED = 'not_allowed'

    STATUS_CHOICES = [(STATUS_SUCCESS, "Success"), (STATUS_PENDING, "Pending"),
                      (STATUS_WARNING, "Warning"), (STATUS_ERROR, "Error"),
                      (STATUS_INFO, "Info"), (STATUS_ALERT, "Alert"),
                      (STATUS_REMINDER, "Reminder"),
                      (STATUS_LOGGER_RESPONSE, "Response from logger"),
                      (STATUS_SYSTEM_ERROR, "System error"),
                      (STATUS_MIXED, "Mixed"),
                      (STATUS_PARSE_ERRROR, "Parse Error"),
                      (STATUS_BAD_VALUE, "Bad Value"),
                      (STATUS_INAPPLICABLE, "Inapplicable"),
                      (STATUS_NOT_ALLOWED, "Not Allowed")]

    date = DateField(('Date'),
                     description=('Date'),
                     validators=[DataRequired()],
                     widget=DatePickerWidget())
    direction = SelectField(('Direction'),
                            choices=DIRECTION_CHOICES,
                            validators=[],
                            widget=Select2Widget())
    text = StringField(('Text'),
                       description=('Text'),
                       validators=[DataRequired()],
                       widget=BS3TextAreaFieldWidget())
    status = SelectField(('Status'),
                         choices=STATUS_CHOICES,
                         validators=[DataRequired()],
                         widget=Select2Widget())
    identity = IntegerField(('Identity'),
                            validators=[validate_telephone,
                                        optional()],
                            widget=BS3TextFieldWidget())
    response_to = StringField(('Response To'), widget=BS3TextFieldWidget())
Beispiel #16
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import StringField

        return {
            "extra__asana__workspace": StringField(lazy_gettext("Workspace"), widget=BS3TextFieldWidget()),
            "extra__asana__project": StringField(lazy_gettext("Project"), widget=BS3TextFieldWidget()),
        }
Beispiel #17
0
class MyForm(DynamicForm):
    field1 = StringField(('Name'),
        description=('Your field number one!'),
        validators = [DataRequired()], widget=BS3TextFieldWidget())
    field2 = StringField(('Designation'),
        description=('Your field number two!'), widget=BS3TextFieldWidget())
    field3 = StringField(('Company'),
        description=('Your field number three!'),widget=BS3TextFieldWidget())
    field4 = StringField(('Job Location'),
        description=('Your field number four!'), widget=BS3TextFieldWidget())
Beispiel #18
0
class MyForm(DynamicForm):
    field1 = StringField(
        ("Field1"),
        description=("Your field number one!"),
        validators=[DataRequired("Error")],
        widget=BS3TextFieldWidget(),
    )
    field2 = StringField(
        ("Field2"), description=("Your field number two!"), widget=BS3TextFieldWidget()
    )
class RenglonVentapedido(Form):
    clienteidentificador = StringField('Cliente', render_kw={'disabled': ''})
    Fecha = DateField('Fecha',
                      format='%d-%m-%Y %H:%M:%S',
                      default=dt.now(),
                      render_kw={'disabled': ''},
                      validators=[DataRequired()])
    producto = SelectField('Producto',
                           coerce=str,
                           choices=[(p.id, p)
                                    for p in db.session.query(Productos)])
    cantidad = IntegerField('Cantidad',
                            widget=BS3TextFieldWidget(),
                            render_kw={'type': "number"})
    metodo = SelectField('Forma de Pago',
                         coerce=str,
                         choices=[(p.id, p)
                                  for p in db.session.query(FormadePago)])
    #condicionfrenteiva= SelectField('Condicion Frente Iva', coerce=TipoClaves.coerce, choices=TipoClaves.choices() )
    total = FloatField('Total $',
                       render_kw={
                           'disabled': '',
                           'align': 'right'
                       },
                       validators=[DataRequired()],
                       default=0)
    numeroCupon = IntegerField('Numero de cupon',
                               render_kw={'type': 'number'},
                               widget=BS3TextFieldWidget())
    companiaTarjeta = SelectField(
        'Compania de la Tarjeta',
        coerce=str,
        choices=[(p.id, p) for p in db.session.query(CompaniaTarjeta)])
    credito = BooleanField("Credito", default=False)
    descuento = FloatField("Descuento %", default=0)
    percepcion = FloatField("Percepcion %",
                            render_kw={'disabled': ''},
                            default=0)
    cuotas = FloatField("Cuotas", render_kw={'type': "number"}, default=0)
    totalneto = FloatField("Total Neto $",
                           render_kw={
                               'disabled': '',
                               'align': 'right'
                           },
                           default=0)
    totaliva = FloatField("Total IVA $",
                          render_kw={
                              'disabled': '',
                              'type': "number",
                              'align': 'right'
                          },
                          default=0)
    comprobante = FloatField("Comprobante",
                             render_kw={'type': "number"},
                             default=0)
Beispiel #20
0
class ContactForm(DynamicForm):
    email = StringField(('Email'),
                        validators=[DataRequired(), Email()],
                        description=('Email we can use to contact you'),
                        widget=BS3TextFieldWidget())
    name = StringField(('Name'),
                       validators=[DataRequired()],
                       widget=BS3TextFieldWidget())
    message = StringField(('Message'),
                          validators=[DataRequired()],
                          widget=BS3TextAreaFieldWidget())
Beispiel #21
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import StringField

        return {
            "extra__jdbc__drv_path": StringField(lazy_gettext('Driver Path'), widget=BS3TextFieldWidget()),
            "extra__jdbc__drv_clsname": StringField(
                lazy_gettext('Driver Class'), widget=BS3TextFieldWidget()
            ),
        }
Beispiel #22
0
    def set_column(self):
        self.add_form_extra_fields['name'] = StringField(
            _(self.datamodel.obj.lab('name')),
            default=g.user.username + "-",
            widget=BS3TextFieldWidget()  # 传给widget函数的是外层的field对象,以及widget函数的参数
        )

        self.add_form_extra_fields['hubsecret'] = StringField(
            _(self.datamodel.obj.lab('hubsecret')),
            default=g.user.username + "-",
            widget=BS3TextFieldWidget()  # 传给widget函数的是外层的field对象,以及widget函数的参数
        )
Beispiel #23
0
class ProfileForm(DynamicForm):
	id = IntegerField(('id'))
	fname = StringField(('fname'),description=('First Name'),validators = [DataRequired()], widget=BS3TextFieldWidget())
	lname = StringField(('lname'),description=('Last Name'), widget=BS3TextFieldWidget())
	email = StringField(('email'),description=('Last Name'), widget=BS3TextFieldWidget())
	#birthday=DateField("birthday", format='%Y/%m/%d', widget=DatePickerWidget())
	streetAddress=StringField("streetAddress", [validators.DataRequired()])
	country=StringField("country", [validators.DataRequired()])
	city=StringField("city", [validators.Length(min=4, max=25)])
	state=StringField("state", [validators.Length(min=4, max=25)])
	zipCode=StringField("zipCode", [validators.Length(min=4, max=25)])
	ethereumAddress=StringField("ethereumAddress", [validators.DataRequired()])
	govID=StringField("govID", [validators.Length(min=4, max=25)])
Beispiel #24
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import StringField

        return {
            "extra__azure_cosmos__database_name": StringField(
                lazy_gettext('Cosmos Database Name (optional)'), widget=BS3TextFieldWidget()
            ),
            "extra__azure_cosmos__collection_name": StringField(
                lazy_gettext('Cosmos Collection Name (optional)'), widget=BS3TextFieldWidget()
            ),
        }
Beispiel #25
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import StringField

        return {
            "extra__azure__tenantId": StringField(
                lazy_gettext('Azure Tenant ID'), widget=BS3TextFieldWidget()
            ),
            "extra__azure__subscriptionId": StringField(
                lazy_gettext('Azure Subscription ID'), widget=BS3TextFieldWidget()
            ),
        }
Beispiel #26
0
    def get_connection_form_widgets() -> Dict[str, Any]:
        """Returns connection widgets to add to connection form"""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import StringField

        return {
            "extra__azure_data_lake__tenant":
            StringField(lazy_gettext('Azure Tenant ID'),
                        widget=BS3TextFieldWidget()),
            "extra__azure_data_lake__account_name":
            StringField(lazy_gettext('Azure DataLake Store Name'),
                        widget=BS3TextFieldWidget()),
        }
Beispiel #27
0
class UserInfoEdit(DynamicForm):
    first_name = StringField(
        lazy_gettext('First Name'),
        validators=[DataRequired()],
        widget=BS3TextFieldWidget(),
        description=lazy_gettext('Write the user first name or names'))
    last_name = StringField(
        lazy_gettext('Last Name'),
        validators=[DataRequired()],
        widget=BS3TextFieldWidget(),
        description=lazy_gettext('Write the user last name'))
    emp_number = StringField(lazy_gettext('Emp. Number'),
                             validators=[DataRequired()],
                             widget=BS3TextFieldWidget(),
                             description=lazy_gettext('Employee Number'))
class ContactModelView(ModelView):
    datamodel = SQLAInterface(Contact)

    label_columns = {'group': 'Contacts Group'}
    list_columns = ['name', 'personal_celphone', 'birthday', 'group']

    base_order = ('name', 'asc')

    show_fieldsets = [
        ('Summary', {'fields': ['name', 'gender', 'group']}),
        (
            'Personal Info',
            {'fields': ['address', 'birthday', 'personal_phone', 'personal_celphone'], 'expanded': False}),
    ]

    add_fieldsets = [
        ('Summary', {'fields': ['name', 'gender', 'group']}),
        (
            'Personal Info',
            {'fields': ['address', 'birthday', 'personal_phone', 'personal_celphone'], 'expanded': False}),
    ]

    add_columns = ['name','personal_phone']

    add_form_extra_fields = {'personal_phone2': TextField('Extra Field',
                    widget=BS3TextFieldWidget())}
Beispiel #29
0
class ClienteForm(Form):
    tipopersona = SelectField('Tipo de persona',
                              coerce=str,
                              validators=[InputRequired()],
                              widget=Select2Widget())
    tipodocumento = SelectField('Tipo de Documento',
                                coerce=str,
                                widget=Select2Widget())
    documento = StringField(
        "Documento",
        validators=[InputRequired(),
                    cuitvalidator(dato='tipoDocumento')])
    tipoclave = SelectField('Cond Frente IVA',
                            coerce=str,
                            validators=[InputRequired()],
                            widget=Select2Widget())
    nombre = StringField("Nombre", validators=[InputRequired()])
    apellido = StringField("Apellido", validators=[InputRequired()])
    direccion = StringField("Direccion", widget=BS3TextFieldWidget())
    localidad = SelectField('Localidad', coerce=str, widget=Select2Widget())
    cuit = StringField("Cuit")
    tipoclavejuridica = SelectField('Cond Frente IVA',
                                    coerce=str,
                                    validators=[InputRequired()],
                                    widget=Select2Widget())
    denominacion = StringField("Denominacion", validators=[InputRequired()])
    razonsocial = StringField("Razon social")
class CreateNews(DynamicForm):

    # Get title for News post, required
    title = StringField(_('Title'),
                        validators=[DataRequired()],
                        widget=BS3TextFieldWidget())

    # Get the news for the News post, required
    news = TextAreaField(
        _('News'),
        render_kw={
            "rows": 15,
            "cols": 40},
        description=_('Please write at least 15 characters and maximum of 400 characters'),
        validators=[
            DataRequired(),
            Length(
                min=15,
                max=400)])

    # Confirm that use accepts that post follows guidelines, required
    rule_check = RadioField(
        _('Community Guidelines'),
        description=_('By accepting this you confirm that your post follows the ommunity guidelines. The guidelines are the in the footer of the page'),
        choices=[
            ('confirm',
             'True'),
            ('deny',
             'False')],
        validators=[
            DataRequired()])