示例#1
0
class EditArticleForm(flask_wtf.FlaskForm):
    name = fields.StringField(
        'Namn',
        validators=[validators.InputRequired(),
                    validators.Length(max=15)])
    value = html5_fields.DecimalField('Pris',
                                      default=0,
                                      render_kw={
                                          'step': .01,
                                          'min': -1000,
                                          'max': 1000
                                      },
                                      validators=[
                                          validators.InputRequired(),
                                          validators.NumberRange(min=-1000,
                                                                 max=1000),
                                      ])
    standardglas = html5_fields.DecimalField('Standardglas',
                                             default=1,
                                             render_kw={'step': .1},
                                             validators=[
                                                 validators.InputRequired(),
                                             ])
    description = fields.TextAreaField(
        'Beskrivning',
        description="Vilka produkter som ingår och/eller beskrivning. "
        "Markdown.")
    weight = fields.IntegerField('Sorteringsvikt',
                                 description="Heltal. En högre vikt sjunker.",
                                 validators=[validators.InputRequired()])
示例#2
0
class EditArticleForm(flask_wtf.FlaskForm):
    name = fields.StringField(
        _l('Namn'),
        validators=[validators.InputRequired(),
                    validators.Length(max=15)])
    value = html5_fields.DecimalField(_l('Pris'),
                                      default=0,
                                      render_kw={
                                          'step': .01,
                                          'min': -1000,
                                          'max': 1000
                                      },
                                      validators=[
                                          validators.InputRequired(),
                                          validators.NumberRange(min=-1000,
                                                                 max=1000),
                                      ])
    standardglas = html5_fields.DecimalField(_l('Standardglas'),
                                             default=1,
                                             render_kw={'step': .1},
                                             validators=[
                                                 validators.InputRequired(),
                                             ])
    description = fields.TextAreaField(
        _l('Beskrivning'),
        description=_l("Vilka produkter som ingår och/eller beskrivning. "
                       "Markdown."))
    weight = html5_fields.IntegerField(
        _l('Sorteringsvikt'),
        description=_l("Heltal. En högre vikt stiger."),
        validators=[validators.InputRequired()])
    is_active = fields.BooleanField(
        _l('Aktiv'),
        description=_l("Produkten är synlig och går att strequa på."),
        default=True)
示例#3
0
class EditarFrios(FlaskForm):
    id = html5.IntegerField('Id', widget=h5widgets.NumberInput(
        min=0), validators=[InputRequired()])
    nome = StringField('Nome', [InputRequired('Este campo é Obrigatório')])
    quantidade = html5.IntegerField('Quantidade', widget=h5widgets.NumberInput(
        min=1), validators=[InputRequired()])
    preco = html5.DecimalField('Preço', validators=[InputRequired()])
示例#4
0
 class F(Form):
     search = html5.SearchField()
     telephone = html5.TelField()
     url = html5.URLField()
     email = html5.EmailField()
     datetime = html5.DateTimeField()
     date = html5.DateField()
     dt_local = html5.DateTimeLocalField()
     integer = html5.IntegerField()
     decimal = html5.DecimalField()
     int_range = html5.IntegerRangeField()
     decimal_range = html5.DecimalRangeField()
示例#5
0
class UserTransactionForm(flask_wtf.FlaskForm):
    value = html5_fields.DecimalField(_l('Transaktionsvärde'),
                                      render_kw={
                                          'step': .01,
                                          'min': -10000,
                                          'max': 10000
                                      },
                                      validators=[
                                          validators.NumberRange(min=-10000,
                                                                 max=10000),
                                      ])

    text = fields.StringField(_l('Meddelande'),
                              validators=[validators.Length(max=50)])
示例#6
0
        class UserTransactionForm(flask_wtf.FlaskForm):
            user_name = fields.HiddenField('Namn', default=user.full_name)
            user_id = fields.HiddenField('ID', default=user.id)

            value = html5_fields.DecimalField(
                'Transaktionsvärde',
                default=0,
                render_kw={
                    'step': .01,
                    'min': -10000,
                    'max': 10000
                },
                validators=[validators.NumberRange(min=-10000, max=10000)])

            text = fields.StringField('Meddelande')
示例#7
0
class CreditTransferForm(flask_wtf.FlaskForm):
    payer_id = fields.HiddenField()
    payee_id = fields.HiddenField()

    message = fields.StringField(_l('Meddelande'),
                                 validators=[validators.Length(max=50)])

    value = html5_fields.DecimalField(_l('Summa'),
                                      render_kw={
                                          'step': .01,
                                          'min': 1,
                                          'max': 10000
                                      },
                                      validators=[
                                          validators.NumberRange(min=1,
                                                                 max=10000),
                                      ])
示例#8
0
class modelMakerForm(FlaskForm):
    def datasetCheck(form, field):
        db.cur.execute('SELECT title FROM datasets WHERE ID=%s;',
                       (field.data, ))
        if not db.cur.fetchall():
            raise ValidationError(
                'We couldn\'t find any datasets with that ID')

    userMode = f.BooleanField('Show advanced options',
                              render_kw={"onclick": "toggle()"})

    datasetID = f5.IntegerField('ID of dataset being used', [datasetCheck])
    description = f.TextAreaField('Description of this model')
    #nnType = f.SelectField('Type of RNN for this model')
    # things get real groovy after here, watch out
    layerAmount = f5.IntegerField(popup.render(
        id='layerAmount',
        label='Amount of hidden layers in this RNN',
        popupText=
        'Hidden layers are layers of neurons in the neural network, which are between the input layer and the output layers. Changing this value has a drastic impact on the model\'s structure.'
    ), [v.NumberRange(1, 250, 'Boi go for a reasonable amount of layers')],
                                  default=2)
    learningRate = f5.DecimalField(popup.render(
        id='learningRate',
        label='Learning rate for this RNN',
        popupText=
        'The learning rate is basically how quickly the model will adapt to new information. Things go badly if it adapts to quickly but you don\'t want it to be lagging behind as information passes by. Slow values are good.'
    ), [v.NumberRange(0, 1, 'We need small numbers')],
                                   places=4,
                                   default=0.002)
    rnnSize = f5.IntegerField(popup.render(
        id='rnnSize',
        label='Size of hidden layers in this RNN',
        popupText=
        'This is the amount neurons (values) in each hidden layer, which has a large impact on the model\'s structure.'
    ), [
        v.NumberRange(
            min=10,
            max=1000,
            message=
            'There should be between 10 and 1,000 neurons. Anything else is ridiculous.'
        )
    ],
                              default=128)
    # maybe add boolean field here so users don't have to say zero?
    dropout = f5.DecimalField(popup.render(
        id='dropout',
        label=
        'Dropout for reqularization, used after each hidden layer in the RNN',
        popupText=
        'Dropout is a system which disconnects certain neurons from others where weights might get messed up, meaning that some things will stop influencing the model (but usually not in noticeable ways).'
    ), [v.NumberRange(0, 1, 'Dropout is from 0-1')],
                              default=0.5)
    seqLength = f5.IntegerField(popup.render(
        id='seqLength',
        label='Sequence length (amount of timesteps the RNN will unroll for)',
        popupText=
        'This is the amount of times that inputs are fully passed to the outputs during a forward pass through the dataset.'
    ), [v.NumberRange(3, 250, 'Should be between 3 and 250')],
                                default=50)
    batchSize = f5.IntegerField(popup.render(
        id='batchSize',
        label=
        'Size of RNN batches (amount of sequences to train on in parallel)',
        popupText=
        'The training data is split up into batches to be processed by Joe individually. This is the amount of characters in each batch.'
    ), [
        v.NumberRange(
            10, 500,
            'Batch size should be between 10 and 500 but really no bigger than 100'
        )
    ],
                                default=50)
    maxEpochs = f5.IntegerField(popup.render(
        id='maxEpochs',
        label='Maximum amount of epochs',
        popupText=
        'An epoch is when Joe goes through the entire datasets forwards and backwards. This is the amount of epochs before this model stops training.'
    ), [
        v.NumberRange(
            3, 300,
            'You gotta have between 3 and 300 epochs (they take a hella long time)'
        )
    ],
                                default=50)
    seed = f5.IntegerField(popup.render(
        id='seed',
        label='Seed for making random numbers',
        popupText=
        'This is the number that is used to create other random numbers. Keeping a consistent seed will mean consistent results.'
    ), [
        v.NumberRange(
            1, 250,
            'Set your seed between 1 and 250, it really doesn\'t matter')
    ],
                           default=123)