Esempio n. 1
0
class ClassForm(FlaskForm):
    # Basic search
    classes = StringField("Enter your classes:", validators=[DataRequired()])
    semester = SelectField('Semester',
                           validators=[DataRequired()],
                           choices=[('F', 'Fall'), ('W', 'Winter'),
                                    ('S', 'Summer')])

    # Advanced options
    lunch = IntegerRangeField('How important is not missing lunch for you?',
                              default=60)
    dinner = IntegerRangeField('How important is not missing dinner for you?',
                               default=60)
    offtime = IntegerRangeField(
        'How important is minimizing time between classes for you?',
        default=40)
    lunch_start = TimeField("At what time would you like to eat lunch?",
                            validators=[DataRequired()])
    lunch_end = TimeField("At what time would you like to eat lunch?",
                          validators=[DataRequired()])
    dinner_start = TimeField("At what time would you like to eat dinner?",
                             validators=[DataRequired()])
    dinner_end = TimeField("At what time would you like to eat dinner?",
                           validators=[DataRequired()])
    wake_up = TimeField("At what time would you like your day to start?",
                        validators=[DataRequired()])

    submit = SubmitField('Optimize')
Esempio n. 2
0
class Logpushups(FlaskForm):
    day = IntegerRangeField("day")
    push_reps = IntegerRangeField("push_reps")
    pull_reps = IntegerRangeField("pull_reps")
    air_reps = IntegerRangeField("air_reps")
    sit_reps = IntegerRangeField("sit_reps")
    dt = HiddenField("date")
Esempio n. 3
0
class SidebarForm(FlaskForm):
    wf_type = SelectField('Choose the Walk_forward type', 
                        choices = [('anchored', 'Anchored Walk Forward'), ('unanchored', 'Unanchored Walk Forward')])
    in_range = IntegerRangeField('Select in sample range')
    out_range = IntegerRangeField('Select out sample range')
    submit = SubmitField('Create Graphs')

    
Esempio n. 4
0
class WebsiteDesignForm(FlaskForm):
    webDesignQ1 = IntegerRangeField(
        '1. How appealing did you find the layout of this news website on first sight?',
        default=0)
    webDesignQ2 = IntegerRangeField(
        '2. How appealing did you find the colours of this news website on first sight?',
        default=0)
    webDesignQ3 = IntegerRangeField(
        '3. Overall, how appealing did you find the design of this website on first sight?',
        default=0)
    submit = SubmitField('Next')
Esempio n. 5
0
class DoubleSliderForm(FlaskForm):
    """
        Class for generating a slider that can be used to reduce the graph.
    """
    slider0 = IntegerRangeField()
    slider1 = IntegerRangeField()
    submit = SubmitField('Update')
    title = 'Select two numbers below for reducing the size of the graph'
    subtitle = ['Subtitle0', 'Subtitle1']

    def get_slider_value(self, index):
        """
        :return: the value from the slider
        """
        name = 'slider{}'.format(index)
        if name in request.form:
            return request.form[name]
        return self.start_value[index]

    def content(self):
        return '''
          <div class="row"><b class="col">{}</b></div>
          <div class="row">  
            <div class="col-sm-3"><span>{}</span></div>
            <div class="col-sm-3" style="text-align: center"><output id="outputValue0">{}</output></div>
            <div class="col-sm-3" style="text-align: right"><span>{}</span></div>
          </div>
          <div class="row">
            <div class="col-sm-9">{}</div>
          </div>
          <div class="row"><b class="col">{}</b></div>
          <div class="row">  
            <div class="col-sm-3"><span>{}</span></div>
            <div class="col-sm-3" style="text-align: center"><output id="outputValue1">{}</output></div>
            <div class="col-sm-3" style="text-align: right"><span>{}</span></div>
          </div>
          <div class="row">
            <div class="col-sm-9">{}</div>
            <div class="col-sm-3">{}</div>
          </div>'''.format(
            self.subtitle[0], self.min_value[0], self.start_value[0],
            self.max_value[0],
            self.slider0(style="width: 100%;",
                         oninput="outputValue0.value=this.value",
                         min=self.min_value[0],
                         max=self.max_value[0],
                         value=self.start_value[0]), self.subtitle[1],
            self.min_value[1], self.start_value[1], self.max_value[1],
            self.slider1(style="width: 100%;",
                         oninput="outputValue1.value=this.value",
                         min=self.min_value[1],
                         max=self.max_value[1],
                         value=self.start_value[1]),
            self.submit(class_="btn btn-primary btn-block"))
Esempio n. 6
0
class AddEntryForm(FlaskForm):
    """Add new session entry form"""
    date = DateField("Date",validators=[InputRequired()])
    therapist = QuerySelectField('Therapist',query_factory=lambda: Therapist.query.all(), allow_blank = False, get_label='full_name')
    nrs1 = IntegerRangeField("NRS1", validators=[InputRequired(), NumberRange(min=0, max=100)])
    nrs2 = IntegerRangeField("NRS2", validators=[InputRequired(), NumberRange(min=0, max=100)])
    nrs3 = IntegerRangeField("NRS3", validators=[InputRequired(), NumberRange(min=0, max=100)])
    nrs4 = IntegerRangeField("NRS4", validators=[InputRequired(), NumberRange(min=0, max=100)])
    nrs5 = IntegerRangeField("NRS5", validators=[InputRequired(), NumberRange(min=0, max=100)])
    a_event = TextAreaField("A: Adversity/ Activating Event: Now that you've checked in with yourself, what would you like to start with today?", validators=[InputRequired()])
    beliefs = TextAreaField("Beliefs (About this Adversity):", validators=[InputRequired()])
    c_distortions = SelectMultipleField('Cognitive Distortions', choices=[('All-or-Nothing Thinking / Polarized Thinking','All-or-Nothing Thinking / Polarized Thinking'),('Awfulizing, Catastrophizing','Awfulizing, Catastrophizing'),('Overgeneralization','Overgeneralization'),('Mental Filter','Mental Filter'),('Disqualifying the Positive','Disqualifying the Positive'),('Jumping to Conclusions – Mind Reading', 'Jumping to Conclusions – Mind Reading'),('Jumping to Conclusions – Fortune Telling', 'Jumping to Conclusions – Fortune Telling'),('Magnification (Catastrophizing) or Minimization','Magnification (Catastrophizing) or Minimization'),('Emotional Reasoning', 'Emotional Reasoning'),('Should Statements', 'Should Statements'),('Labeling and Mislabeling', 'Labeling and Mislabeling'),('Personalization', 'Personalization'),('Control Fallacies','Control Fallacies'),('Fallacy of Fairness', 'Fallacy of Fairness'),('Fallacy of Change', 'Fallacy of Change'),('Always Being Right', 'Always Being Right'),('If/Then, Non-sequitur', 'If/Then, Non-sequitur')], option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False))
    c_consequences = SelectMultipleField('C: Consequences: Emotional- Unhealthy Negative Emotions Identified', choices=[('Anger','Anger'),('Anxiety','Anxiety'),('Depression','Depression'),('Guilt','Guilt'),('Shame','Shame'),('Resentment','Resentment'),('Jealousy','Jealousy'),('Panic','Panic')], option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False))
    reactions = TextAreaField("C- Consequences: Behaviors & Reactions", validators=[InputRequired()])
 class InteractiveMetricMaintainabilityForm(FlaskForm):
     importance = IntegerRangeField("Importance to you:",
                                    render_kw={
                                        "value": 1,
                                        "min": 0,
                                        "max": 1
                                    })
Esempio n. 8
0
class ReusableForm(Form):
    """User entry form for entering specifics for generation"""
    # Starting seed
    seed = TextField("請輸入一個起始句子:",
                     default="新冠病毒與sars結合成新型病毒",
                     validators=[validators.InputRequired()])

    # Configure GPT2
    length = IntegerField("生成長度 (<=1024):",
                          default=200,
                          validators=[
                              validators.InputRequired(),
                              validators.NumberRange(-1, 1024)
                          ])
    temperature = DecimalField("文章生成的隨機度 (0.1-3):",
                               default=1.2,
                               places=1,
                               validators=[
                                   validators.InputRequired(),
                                   validators.NumberRange(0.1, 3)
                               ])
    topk = IntegerField("前k大的機率頻繁詞抽樣:",
                        default=50,
                        validators=[validators.InputRequired()])
    topp = DecimalField("前k大的累積機率頻繁詞抽樣:",
                        default=0,
                        validators=[validators.InputRequired()])
    fast_pattern = BooleanField("采用更加快的方式生成文本:", default=False)
    nsamples = IntegerRangeField('生成幾個樣本:', default=2)
    modelname = SelectField('模型', validators=[validators.InputRequired()])
    fast_pattern = BooleanField("采用更加快的方式生成文本:", default=False)

    # Submit button
    submit = SubmitField("開始產生文章")
Esempio n. 9
0
class RandomNumberForm(FlaskForm):
    # DataRequired validator was not working properly
    user_guess = IntegerField("Your Guess", validators=[InputRequired()])
    # range max and min values are handled in template file
    num_range_select = IntegerRangeField("Number Range: ")
    num_range_text = StringField()
    submit = SubmitField("Submit")
class UrlForm(FlaskForm):
    url = StringField(
        'URL',
        validators=[validators.DataRequired(), validators.URL(message='Sorry, this is not a valid URL,')])

    wMin = IntegerRangeField(
        'Min. words',
        default=5,
        validators=[validators.DataRequired(), validators.NumberRange(min=1, max=20)])

    extractor_class = SelectField(
        'Extractor',
        default=langid.EXTRACTORS[0],
        choices=[(i, i) for i in langid.EXTRACTORS],
        validators=[validators.DataRequired()])

    model_class = SelectField(
        'Model',
        default=langid.MODELS[0],
        choices=[(i, i) for i in langid.MODELS],
        validators=[validators.DataRequired()])

    return_raw = BooleanField(
        'Display raw sentences',
        default=False
    )
Esempio n. 11
0
class RefundRequestForm(Form):
    # https://developer.gocardless.com/api-reference/#appendix-local-bank-details
    # We only support UK and international (Euros)
    sort_code = StringField(
        "Sort code",
        [
            required_for(currency="GBP",
                         providers=["banktransfer", "gocardless"])
        ],
    )
    account = StringField(
        "Account number",
        [
            required_for(currency="GBP",
                         providers=["banktransfer", "gocardless"])
        ],
    )
    iban = StringField("IBAN", [
        required_for(currency="EUR", providers=["banktransfer", "gocardless"])
    ])
    swiftbic = StringField(
        "SWIFT BIC",
        [
            required_for(currency="EUR",
                         providers=["banktransfer", "gocardless"])
        ],
    )
    donation_amount = IntegerRangeField("Donation amount")
    payee_name = StringField(
        "Name of account holder",
        [required_for(providers=["banktransfer", "gocardless"])],
    )
    note = StringField("Note")
    submit = SubmitField("Request refund")
Esempio n. 12
0
class SliderForm(FlaskForm):
    """
        Class for generating a slider that can be used to reduce the graph.
    """
    slider = IntegerRangeField()
    submit = SubmitField('Update')
    title = 'Select a number below for reducing the size of the graph'

    def get_slider_value(self):
        """
        :return: the value from the slider
        """
        if 'slider' in request.form:
            return request.form['slider']
        return self.start_value

    def content(self):
        return '''
          <div class="row">
            <div class="col-sm-3"><span>{}</span></div>
            <div class="col-sm-3" style="text-align: center"><output id="outputValue">{}</output></div>
            <div class="col-sm-3" style="text-align: right"><span>{}</span></div>
          </div>
          <div class="row">
            <div class="col-sm-9">{}</div>
            <div class="col-sm-3">{}</div>
          </div>'''.format(
            self.min_value, self.start_value, self.max_value,
            self.slider(style="width: 100%;",
                        oninput="outputValue.value=this.value",
                        min=self.min_value,
                        max=self.max_value,
                        value=self.start_value),
            self.submit(class_="btn btn-primary btn-block"))
 class AutoMetricPortabilityForm(FlaskForm):
     importance = IntegerRangeField("Importance to you:",
                                    render_kw={
                                        "value": 1,
                                        "min": 0,
                                        "max": 1
                                    })
Esempio n. 14
0
class TestForm(FlaskForm):
    name = TextField('Your name',
                     validators=[Length(3, 5)],
                     render_kw={'autofocus': 'autofocus'})
    password = PasswordField(description='Your favorite password',
                             validators=[])
    email = EmailField(u'Your email address')
    mobile_phone = FormField(TelephoneForm)
    flist = FieldList(StringField('FieldList "Name"'),
                      min_entries=2,
                      label='Authors')
    remember = BooleanField(
        'Check me out',
        validators=[],
        description='Lorem ipsum dolor sit amet, consectetur '
        'adipiscing elit. Mauris ultricies libero '
        'lacus, eu ornare ex imperdiet quis. Sed non '
        'aliquet magna. Praesent gravida odio id massa '
        'condimentum, quis imperdiet nunc luctus.')
    ranger = IntegerRangeField('The Lone Ranger',
                               default=3,
                               render_kw={
                                   'step': 1,
                                   'min': 0,
                                   'max': 6,
                                   'class': 'custom-range'
                               })
    a_float = FloatField(u'A floating point number')
    a_decimal = DecimalField(places=2, rounding='ROUND_HALF_UP', validators=[])
    a_integer = IntegerField(u'An integer')
    sample_file = FileField(u'Your favorite file',
                            description='A file you would like to upload.')
    radio = RadioField('Radio Gaga',
                       choices=[('ch_01', 'Choice 01'), ('ch_02', 'Choice 02'),
                                ('ch_03', 'Choice 03')],
                       default='ch_02',
                       description='Lorem ipsum dolor sit amet, consectetur '
                       'adipiscing elit. Mauris ultricies libero '
                       'lacus, eu ornare ex imperdiet quis. Sed non '
                       'aliquet magna. Praesent gravida odio id massa '
                       'condimentum, quis imperdiet nunc luctus.')
    select = SelectField('Person',
                         choices=[('ch_01', 'Choice 01'),
                                  ('ch_02', 'Choice 02'),
                                  ('ch_03', 'Choice 03')],
                         default='ch_03',
                         validators=[DataRequired()])
    select_multi = SelectMultipleField('Persons',
                                       choices=[('ch_01', 'Choice 01'),
                                                ('ch_02', 'Choice 02'),
                                                ('ch_03', 'Choice 03')],
                                       default=['ch_01', 'ch_03'],
                                       validators=[DataRequired()])
    birthday = DateField(u'Your birthday', default=date.today)
    date_time = DateTimeField(u'DateTime', default=datetime.now)
    date_time_local = DateTimeLocalField(u'DateTimeLocal',
                                         format='%Y-%m-%dT%H:%M',
                                         default=datetime.now)
    submit = SubmitField(u'Submit Form')
Esempio n. 15
0
 def getField(self, question):
     kind = question.kind
     qlabel = [b for a, b in QUESTION_KIND_CHOICES if a == kind][0]
     qtype = "response"
     if kind == "text":
         qlabel = "Write your response below."
         return (
             qtype,
             TextAreaField(qlabel, render_kw={"placeholder":
                                              "Your answer"}),
         )
     if kind == "yes-no":
         return (
             qtype,
             RadioField(qlabel, choices=[(1, "Yes"), (0, "No")],
                        coerce=int),
         )
     if kind == "numeric":
         qlabel = "Drag the slider below."
         return (
             qtype,
             IntegerRangeField(qlabel,
                               [validators.NumberRange(min=1, max=9)],
                               default=1),
         )
     if kind == "select":
         qlabel = "Select one or more from the following:"
         try:
             choices = json.loads(question.choices, strict=False)
         except:
             choices = {}
         return (
             qtype,
             SelectMultipleField(
                 qlabel,
                 choices=[(a, b) for a, b in choices.items()],
                 coerce=int,
                 widget=select_multi_checkbox,
             ),
         )
     if kind == "radio":
         qlabel = "Choose from the following:"
         try:
             choices = json.loads(question.choices, strict=False)
         except:
             choices = {}
         return (
             qtype,
             RadioField(qlabel,
                        choices=[(a, b) for a, b in choices.items()],
                        coerce=int),
         )
     else:  # if something is wrong
         qlabel = "Write your response below."
         return (
             qtype,
             TextAreaField(qlabel, render_kw={"placeholder":
                                              "Your answer"}),
         )
Esempio n. 16
0
class CreateProfileForm(FlaskForm):
    profilePic = FileField('Profile Pic', validators=[FileAllowed(['jpg', 'png', 'jpeg'], 'Images only!')])
    profilePicBase64 = HiddenField("profilePicBase64")
    pronouns = StringField('Pronouns', validators=[DataRequired()])
    classYear = IntegerField('Year of Expected Graduation', validators=[DataRequired(), NumberRange(min=2021)])
    funFact = StringField('A Fun Fact About Yourself')
    guideQuestionOne = StringField('Give us three questions that you want people to ask you about')
    guideQuestionTwo = StringField('')
    guideQuestionThree = StringField('')
    bio = StringField('Tell us more about yourself.')
    sportsQuestion = IntegerRangeField('How often do you run/walk around the nature trail? (1 to 5)', render_kw={"min": "1", "max": "5"})
    readingQuestion = IntegerRangeField('How likely are you to say yes if someone challenges you to swim in the duck pond? (1 to 5)', render_kw={"min": "1", "max": "5"})
    cookingQuestion = IntegerRangeField('How much do you enjoy using the stir fry booth in the DC? (1 to 5)', render_kw={"min": "1", "max": "5"})
    DCFoodQuestion = IntegerRangeField('How often do you visit Drinker House on Saturday nights? (1 to 5)', render_kw={"min": "1", "max": "5"})
    MoviesVBoardGamesQuestion = IntegerRangeField('How would you compare your interest in movies to your interest in board games? (1=Movies are way better, 2=Movies are slightly better, 3=They\'re equally interesting, 4=Board games are slightly better, 5=Board games are way better)', render_kw={"min": "1", "max": "5"})
    phoneNotification = StringField('Enter your phone number if you want to receive message notifictaions')
    submit = SubmitField()
Esempio n. 17
0
class SearchForm(FlaskForm):
    """Form for using recommendation search"""

    genre = SelectField("Genre", choices=[])
    key = SelectField("Key", choices=[])
    mode = SelectField("Mode", choices=[])
    tempo = IntegerRangeField("Tempo")
    danceability = DecimalRangeField("Danceability")
    energy = DecimalRangeField("Energy")
    speechiness = DecimalRangeField("Speechiness")
    acousticness = DecimalRangeField("Acousticness")
    instrumentalness = DecimalRangeField("Instrumentalness")
    liveness = DecimalRangeField("Liveness")
    valence = DecimalRangeField("Valence")
    popularity = IntegerRangeField("Popularity")
    loudness = DecimalRangeField("Loudness")
    duration_ms = IntegerRangeField("Duration")
Esempio n. 18
0
class HouseForm(FlaskForm):
    PROPERTY_TYPES = [('APARTMENT', 'Apartment'),
                      ('CONDO', 'Condo'),
                      ('MULTI_FAMILY', 'Multi-Family'),
                      ('SINGLE_FAMILY', 'Single-Family'),
                      ('TOWNHOUSE', 'Townhouse')]

    NEIGHBORHOODS = [('Allston', 'Allston'),
                     ('Back Bay', 'Back Bay'),
                     ('Bay Village', 'Bay Village'),
                     ('Beacon Hill', 'Beacon Hill'),
                     ('Brighton', 'Brighton'),
                     ('Charlestown', 'Charlestown'),
                     ('Chinatown', 'Chinatown'),
                     ('Downtown', 'Downtown'),
                     ('Downtown Crossing', 'Downtown Crossing'),
                     ('East Boston', 'East Boston'),
                     ('Fenway', 'Fenway'),
                     ('Hyde Park', 'Hyde Park'),
                     ('Jamaica Plain', 'Jamaica Plain'),
                     ('Kenmore', 'Kenmore'),
                     ('Leather District', 'Leather District'),
                     ('Mattapan', 'Mattapan'),
                     ('Mission Hill', 'Mission Hill'),
                     ('North Dorchester', 'North Dorchester'),
                     ('North End', 'North End'),
                     ('Roslindale', 'Roslindale'),
                     ('Roxbury', 'Roxbury'),
                     ('South Boston', 'South Boston'),
                     ('South Dorchester', 'South Dorchester'),
                     ('South End', 'South End'),
                     ('West End', 'West End'),
                     ('West Roxbury', 'West Roxbury'),
                     ('Winthrop', 'Winthrop')]

    finished_sq_ft = IntegerRangeField('Square Foot', default=2500)
    lot_size = IntegerRangeField('Lot Size', default=2500)
    bedroom = StringField('Beds', validators=[DataRequired()])
    bathroom = StringField('Baths', validators=[DataRequired()])
    total_room = StringField('Total Rooms', validators=[DataRequired()])
    built_year = StringField('Year Built', validators=[DataRequired()])
    property_type = SelectField('Property Type', choices=PROPERTY_TYPES)
    neighborhood = SelectField('Neighborhood', choices=NEIGHBORHOODS)
    submit = SubmitField('Submit')
Esempio n. 19
0
class BodyForm(FlaskForm):
    config = requests.get('http://0.0.0.0:4996/api/27/getInfo').json()['data']
    # ['PONTLAB_1', 'PONTLAB_2', 'PV_1', "PV_2", "WIND_1", "WIND_2", 'BESS_1', 'BESS_2', 'LOAD_1', 'LOAD_2','LOAD_3', 'LOAD_4', "CONF_1", "CONF_2","CONF_3", "CONF_4","CONF_5", "CONF_6", "CONF_7" ]

    i = 0
    for c in config:
        #if c['name'] == 'PONTLAB_1' or c['name'] == 'PONTLAB_2' or c['name'] ==  'BESS_1' or c['name'] == 'BESS_2' or c['name'] == 'LOAD_4':
        #    continue
        vars()[c['name']] = IntegerRangeField(_prefix=i, label=c['name'], default=0, description=c['description'])
        vars()[str(c['id'])] = StringField(default=c['description'])
        i += 1
Esempio n. 20
0
class MovesForm(Form):
    is_z = BooleanField('Czy jest sygnał Z?')
    num = IntegerRangeField('Ile jest stanów?')
    ff_type = RadioField('Jaki jest typ przerzutnika?',
                         default='jk',
                         choices=(('jk', 'JK'), ('d', 'D'), ('t', 'T')))
    solve = SubmitField('SOLVE!')

    def get_field(self, x, y):
        field = 'move_{}_{}'.format(x, y)
        return vars(self)[field](min=0, max=MAX_MOVE - 1)
Esempio n. 21
0
class ReviewForm(FlaskForm):
    content = TextAreaField('Comment', [
        DataRequired(message='Comment Text is required'),
        Length(min=10, message='Comment must be at lease 10 characters')
    ])
    rating = IntegerRangeField(label='Rating',
                               validators=[
                                   DataRequired(message='Rating is required'),
                                   NumberRange(min=1, max=10)
                               ],
                               widget=RangeInput(step=1))
    submit = SubmitField('Submit Review')
Esempio n. 22
0
class ControlAndDeliberationForm(FlaskForm):
    perceivedControlQ1 = IntegerRangeField(
        '1. How much control did you feel the consent form gave you over the amount of your personal information collected by the company?',
        default=0,
    )
    perceivedControlQ2 = IntegerRangeField(
        '2. How much control did you feel the consent form gave you over who can get access to your personal information?',
        default=0,
    )
    perceivedControlQ3 = IntegerRangeField(
        '3. How much control did you feel the consent form gave you over your personal information that has been released?',
        default=0,
    )
    perceivedControlQ4 = IntegerRangeField(
        '4. How much control did you feel the consent form gave you over how your personal information is being used by the company?',
        default=0,
    )
    perceivedControlQ5 = IntegerRangeField(
        '5. Overall, how much did the consent form made you feel in control over your personal information provided to the company?',
        default=0,
    )
    manipulationCheck = RadioField('1. Which option did you choose?',
                                   choices=[('A', 'Agree'),
                                            ('DNA', 'Do Not Agree')],
                                   validators=[InputRequired()])
    deliberation = IntegerRangeField(
        '2. How much did you think about your decision before clicking on one option?',
        default=0,
    )
    submit = SubmitField('Next')
Esempio n. 23
0
class RegistrationForm(FlaskForm):
    username = StringField('Username',
                            validators = [DataRequired(), Length(min=2, max=20)])
    email = StringField('Email',
                        validators = [DataRequired(), Email()])
    password = PasswordField('Password', validators = [DataRequired()])
    confirm_password = PasswordField('Confirm Password',
                                        validators = [DataRequired(), EqualTo('password')])

    business = IntegerRangeField('Business', default=1, validators = [DataRequired()])
    entertainment = IntegerRangeField('Entertainment', default=1, validators = [DataRequired()])
    health = IntegerRangeField('Health', default=1, validators = [DataRequired()])
    science = IntegerRangeField('Science', default=1, validators = [DataRequired()])
    sports = IntegerRangeField('Sports', default=1, validators = [DataRequired()])
    technology = IntegerRangeField('Technology', default=1, validators = [DataRequired()])

    submit = SubmitField('Sign Up')

    def validate_username(self, username):
        user = UserDetails.query.filter_by(username=username.data).first()
        if user:
            raise ValidationError('That username is taken. Please choose a different one.')

    def validate_email(self, email):
        user = UserDetails.query.filter_by(email=email.data).first()
        if user:
            raise ValidationError('That email is taken. Please choose a different one.')
Esempio n. 24
0
class DeviceForm(FlaskForm):
    device = SelectMultipleField('Devices', coerce=int)
    slider = IntegerRangeField(
        'Date Range',
        default=7,
        validators=[validators.NumberRange(min=1, max=30)])
    day = StringField('', default='7', render_kw={'readonly': True})
    submit = SubmitField('Submit')

    def __init__(self, devices, *args, **kwargs):
        super(DeviceForm, self).__init__(*args, **kwargs)
        self.device.choices = [(device.id, device.name) for device in devices]
        self.devices = devices
Esempio n. 25
0
class DatasetParametersForm(FlaskForm):
    """Dataset configuration with static parameters.

    Inherit:
        FlaskForm
    """

    train_partition = IntegerRangeField("Train/Test partition",
                                        default=70,
                                        validators=[NumberRange(1, 100)])
    k_folds = IntegerField("Number of folds",
                           default=2,
                           validators=[NumberRange(2)])
Esempio n. 26
0
class ChordForm(FlaskForm):
    chord_1 = SelectField('Chord 1',
                          validators=[DataRequired()],
                          choices=[('Dm', 'Dm'), ('F', 'F'), ('Am', 'Am'),
                                   ('G', 'G')])
    chord_2 = SelectField('Chord 2', validators=[DataRequired()], choices=[])
    chord_3 = SelectField('Chord 3', validators=[DataRequired()], choices=[])
    chord_4 = SelectField('Chord 4', validators=[DataRequired()], choices=[])

    num_bars = IntegerRangeField('Number Of Bars', validators=[DataRequired()])
    temperature = DecimalRangeField('Temperature', validators=[DataRequired()])

    submit = SubmitField('Submit')
class Filter(FlaskForm):
    '''various fields on the basis of which filtering can be done '''
    minrent = IntegerRangeField('Minimum rent')
    maxrent = IntegerRangeField('Maximum rent')
    furnishing_type = BooleanField('Fully-Furnished')
    furnishing_type1 = BooleanField('Semi-Furnished')
    furnishing_type2 = BooleanField('Not furnished')
    bedrooms4 = BooleanField('4-BHK')
    bedrooms3= BooleanField('3-BHK')
    bedrooms2 = BooleanField('2-BHK')
    bedrooms = BooleanField('1-BHK')
    refrigerator = BooleanField('Refrigerator')
    washing_machine = BooleanField('Washing Machine')
    ac = BooleanField('AC')
    almirah = BooleanField('Almirah')
    bed = BooleanField('Bed')
    geyser = BooleanField('Geyser')
    gas_stove = BooleanField('Gas Stove')
    sofa = BooleanField('Sofa Set')
    flat_rating=IntegerRangeField('Minimum Rating')
    submit = SubmitField('Apply')
    ''' button to apply the given filter '''
Esempio n. 28
0
class SurveyForm(FlaskForm):
    workshop_id = HiddenField("Workshop id", validators=[DataRequired()])
    difficulty = IntegerRangeField("The lecture presented has a reasonable difficulty curve", default=3)
    assistant = IntegerRangeField("The teaching assistants were helpful", default=3)
    knowledgeable = IntegerRangeField("The trainer was knowledgeable about the training topics", default=3)
    objective = IntegerRangeField("My training objectives were met", default=3)
    time = IntegerRangeField("The time allocated for the training was sufficient", default=3)
    venue = IntegerRangeField("Training venue and facilities were adequate and comfortable", default=3)
    satisfaction = IntegerRangeField("What is your overall experience in this workshop?", default=3)
    comments = TextAreaField("Additional comments/ideas/improvements to your lead instructor and the training organizer")

    submit = SubmitField('Submit')
Esempio n. 29
0
class Formfisio(FlaskForm):
    paciente = StringField('Nome do Paciente')
    username_profissional = StringField('Relatado Por')
    banho = BooleanField('Banho')
    vestir = BooleanField('Vestir-se')
    higiene = BooleanField('Higiene')
    transferencia = BooleanField('Transferência')
    banho = BooleanField('Banho')
    continencia = BooleanField('Continência')
    alimentacao = BooleanField('Alimentação')
    niveldor = IntegerRangeField('Nível de dor',
                                 validators=[Required(),
                                             NumberRange(1, 10)])
    salvar = SubmitField('Salvar')
Esempio n. 30
0
class AddDropoutLayerForm(Form):
    rate = IntegerRangeField(
        label='Rate: a percentage of neurons that are disabled randomly',
        validators=[
            validators.DataRequired('A dropout rate is required'),
            validators.NumberRange(
                min=0,
                max=75,
                message="The input range for dropout must be between 0 and 75")
        ],
        render_kw={
            'min': 0,
            'max': 100
        })