Esempio n. 1
0
class SelectView(FlaskForm):
    options = RadioField(
        choices=['Show all items', 'Detailed view of single item'],
        validators=[DataRequired()])
    item_name = SelectField('Item to view')
    time_to_show = RadioField('Show actions for last:',
                              choices=['week', 'month', 'year', 'all'],
                              default='week')
    submit = SubmitField('Show selection')
Esempio n. 2
0
class ProjectSettingsForm(Form):
    min_version = IntegerField('Minimum library version:',
                               [validators.Optional()])
    min_client_version = IntegerField('Minimum pipeline version:',
                                      [validators.Optional()])
    alphabet = StringField('Alphabet:', [validators.InputRequired()])
    url_template = StringField('URL template:', [
        validators.InputRequired(),
        validators.Regexp(
            '^https?://.+{shortcode}',
            message='Template does not look like a URL template.'),
    ])
    request_delay = FloatField('Time between requests (seconds)',
                               [validators.InputRequired()])
    method = RadioField('HTTP method (get/head):',
                        [validators.InputRequired()],
                        choices=[('head', 'head'), ('get', 'get')])
    redirect_codes = NumListField('Redirect status codes:',
                                  [validators.InputRequired()])
    no_redirect_codes = NumListField('No redirect status codes:',
                                     [validators.InputRequired()])
    unavailable_codes = NumListField('Unavailable status codes:', )
    banned_codes = NumListField('Banned status codes:', )
    body_regex = StringField('Content body regular expression:')
    location_anti_regex = StringField(
        'Location header reject regular expression:')
Esempio n. 3
0
class NewBookingFormBase(IndicoForm):
    start_dt = DateTimeField('Start date', validators=[InputRequired()], parse_kwargs={'dayfirst': True},
                             display_format='%d/%m/%Y %H:%M')
    end_dt = DateTimeField('End date', validators=[InputRequired()], parse_kwargs={'dayfirst': True},
                           display_format='%d/%m/%Y %H:%M')
    repeat_frequency = RadioField('Repeat frequency', coerce=int, default=0, validators=[InputRequired()],
                                  choices=[(0, _('Once')), (1, _('Daily')), (2, _('Weekly')), (3, _('Monthly'))])
    repeat_interval = IntegerField('Repeat interval', validators=[NumberRange(0, 3)], default=0)

    def validate_repeat_interval(self, field):
        if (self.repeat_frequency.data, self.repeat_interval.data) not in RepeatMapping.mapping:
            raise ValidationError('Invalid repeat step')

    def validate_start_dt(self, field):
        if field.data != field.object_data and field.data.date() < date.today() and not session.user.is_admin:
            raise ValidationError(_('The start time cannot be in the past.'))

    def validate_end_dt(self, field):
        start_dt = self.start_dt.data
        end_dt = self.end_dt.data
        if start_dt.time() >= end_dt.time():
            raise ValidationError('Invalid times')
        if self.repeat_frequency.data == RepeatFrequency.NEVER:
            field.data = datetime.combine(start_dt.date(), field.data.time())
        elif start_dt.date() >= end_dt.date():
            raise ValidationError('Invalid period')
Esempio n. 4
0
class NewBookingConfirmForm(NewBookingPeriodForm):
    room_usage = RadioField(
        [DataRequired()],
        choices=[('current_user', _("I'll be using the room myself")),
                 ('other_user', _("I'm booking the room for someone else"))])
    booked_for_user = PrincipalField(
        _('User'), [HiddenUnless('room_usage', 'other_user'),
                    DataRequired()],
        allow_external=True)
    booking_reason = TextAreaField(_('Reason'), [DataRequired()])
    uses_vc = BooleanField(_('I will use videoconference equipment'))
    used_equipment = IndicoQuerySelectMultipleCheckboxField(
        _('VC equipment'), get_label=lambda x: x.name)
    needs_vc_assistance = BooleanField(
        _('Request assistance for the startup of the videoconference session. '
          'This support is usually performed remotely.'))
    needs_assistance = BooleanField(
        _('Request personal assistance for meeting startup'))
    submit_book = SubmitField(_('Create booking'))
    submit_prebook = SubmitField(_('Create pre-booking'))

    def validate_used_equipment(self, field):
        if field.data and not self.uses_vc.data:
            raise ValidationError(_('Videoconference equipment is not used.'))
        elif not field.data and self.uses_vc.data:
            raise ValidationError(
                _('Please select the type of videoconference that you will use.'
                  ))

    def validate_needs_vc_assistance(self, field):
        if field.data and not self.uses_vc.data:
            raise ValidationError(_('Videoconference equipment is not used.'))
Esempio n. 5
0
class ShowForm(FlaskForm):
    artist_id = SelectField(
        'Artist', validators=[InputRequired()],
        coerce=int,
        choices=[]
    )
    venue_id = SelectField(
        'Venue', validators=[InputRequired()],
        coerce=int,
        choices=[]
    )
    start_time = DateTimeField(
        'Start time',
        validators=[InputRequired(),
                    ValidateDateTime(min_dt=ValidateDateTime.FIELD_DEFAULT, dt_format=APP_DATETIME_FMT)],
        format=APP_DATETIME_FMT,
        default=current_datetime()
    )
    duration = RadioField(
        'Duration', validators=[],
        coerce=int,
        choices=DURATION_CHOICES
    )
    other_duration = AppTimeField(
        'Other Duration', validators=[Optional()],
        format=APP_TIME_FMT
    )

    def validate_duration(self, field):
        if field.data == OTHER_DURATION:
            self.other_duration.validators = [InputRequired()]
        else:
            self.other_duration.validators = [Optional()]
Esempio n. 6
0
class BuyerSignupForm(DmForm):
    employment_status = RadioField(
        label=
        'I am a public service employee or have authorisation, as described above.',
        choices=[
            ('employee',
             'I am an employee under the Commonwealth Public Service Act (1999) or under equivalent state or territory legislation and need access to the Digital Marketplace to perform my role.'
             ),  # noqa
            ('contractor',
             'I am a contractor working in local, state or federal government.'
             ),
        ],
        default='',
        validators=[
            DataRequired(message='You must specify your employment status')
        ])

    name = StripWhitespaceStringField(
        'Your full name',
        id='name',
        validators=[
            DataRequired(message='You must provide your full name'),
        ])

    email_address = StripWhitespaceStringField(
        'Email',
        id="input_email_address",
        validators=[
            DataRequired(message='You must provide an email address'),
            government_email_validator,
        ])
Esempio n. 7
0
def quiz_factory(quiz):
    class QuizForm(FlaskForm):
        pass

    for question in quiz.questions:
        if question.is_multicorrect:
            setattr(
                QuizForm, f"question_{question.id}",
                SelectMultipleField(question.question,
                                    choices=[(option.id, option.option)
                                             for option in question.options],
                                    coerce=int,
                                    validators=[DataRequired('Data required')
                                                ]))
        else:
            setattr(
                QuizForm, f"question_{question.id}",
                RadioField(question.question,
                           choices=[(option.id, option.option)
                                    for option in question.options],
                           coerce=int,
                           validators=[DataRequired('Data required')]))
    setattr(QuizForm, 'Submit', SubmitField('Submit'))
    print(vars(QuizForm))
    return QuizForm, ['Submit']
Esempio n. 8
0
class SortShopList(FlaskForm):
    options = RadioField(choices=[
        ('name', 'Sort by Item Name'),
        ('percent', 'Sort by percent of Minimum Stock'),
        ('days', 'Sort by predicted days to minimum stock')
    ],
                         validators=[DataRequired()])
    submit = SubmitField('Choose Sorting Method')
Esempio n. 9
0
class SelectEdit(FlaskForm):
    options = RadioField(choices=[('new', 'Add New Item to Stock List'),
                                  ('remove', 'Remove Item From Stock List'),
                                  ('edit',
                                   'Edit Name or Minimum Stock of Item')],
                         default='new',
                         validators=[DataRequired()])
    submit = SubmitField('Select Change')
Esempio n. 10
0
class StartForm(Form):  #IGNORE:R0924
    """
    Start the signup process. Involves choosing 'preflop' or 'situation' path.
    """
    path = RadioField(choices=[
        ('situations', 'Situations - post-flop situation training'),
        ('preflop', 'Preflop - complete hand training')
    ],
                      default='situations',
                      validators=[Required()])
Esempio n. 11
0
class NewBookingSimpleForm(NewBookingConfirmForm):
    submit_check = SubmitField(_('Check conflicts'))
    booking_reason = TextAreaField(_('Reason'), [UsedIf(lambda form, field: not form.submit_check.data),
                                                 DataRequired()])
    room_usage = RadioField(validators=[UsedIf(lambda form, field: not form.submit_check.data), DataRequired()],
                            choices=[('current_user', _("I'll be using the room myself")),
                                     ('other_user', _("I'm booking the room for someone else"))])
    booked_for_user = PrincipalField(_('User'), [UsedIf(lambda form, field: not form.submit_check.data),
                                                 HiddenUnless('room_usage', 'other_user'),
                                                 DataRequired()], allow_external=True)
Esempio n. 12
0
class NewBookingCriteriaForm(NewBookingFormBase):
    room_ids = SelectMultipleField('Rooms', [DataRequired()], coerce=int)
    flexible_dates_range = RadioField('Flexible days', coerce=int, default=0,
                                      choices=[(0, _('Exact')),
                                               (1, '&plusmn;{}'.format(_('1 day'))),
                                               (2, '&plusmn;{}'.format(_('2 days'))),
                                               (3, '&plusmn;{}'.format(_('3 days')))])

    def validate_flexible_dates_range(self, field):
        if self.repeat_frequency.data == RepeatFrequency.DAY:
            field.data = 0
Esempio n. 13
0
class DataAnalysis(Form):
    NONE_LABEL = 'None'
    YEAR_LABEL = 'Year'
    MONTH_LABEL = 'Month'
    WEEK_LABEL = 'Week'

    patient = BooleanField('Patient', default=False)
    test_type = BooleanField('Test type', default=False)
    test_date = RadioField('Test Date',
                           default=NONE_LABEL,
                           choices=[(NONE_LABEL, NONE_LABEL),
                                    (YEAR_LABEL, YEAR_LABEL),
                                    (MONTH_LABEL, MONTH_LABEL),
                                    (WEEK_LABEL, WEEK_LABEL)])
Esempio n. 14
0
class PredictDataForm(FieldsRequiredForm):
    passenger_class = RadioField('Passenger class',
                                 choices=[(1, 'First'), (2, 'Second'),
                                          (3, 'Third')],
                                 coerce=int)
    sex = RadioField('Sex', choices=[(0, 'Male'), (1, 'Female')], coerce=int)
    age = IntegerField('Age', validators=[InputRequired()])
    siblings_or_spouse = IntegerField('Number of siblings or spouses aboard',
                                      validators=[InputRequired()])
    parch = IntegerField('Number of parents or children aboard',
                         validators=[InputRequired()])
    fare = IntegerField('Fare', validators=[InputRequired()])
    embarked = StringField('Embarked',
                           validators=[
                               InputRequired(),
                               AnyOf(
                                   ['cherbourg', 'queenstown', 'southampton'])
                           ])
    embarked = RadioField('Embarked',
                          choices=[('cherbourg', 'Cherbourg'),
                                   ('queenstown', 'Queenstown'),
                                   ('southampton', 'Southampton')])
    submit = SubmitField('Submit')
Esempio n. 15
0
class StockUpdate(FlaskForm):
    """"form for update stock view"""
    item_name = SelectField('Stock Item', validators=[DataRequired()])
    item_quantity = IntegerField(
        'Quantity', validators=[DataRequired(),
                                NumberRange(min=1)])
    actions = RadioField(choices=[
        'New stock to kitchen', 'New stock to garage',
        'Move from kitchen to garage', 'Move from garage to kitchen',
        'Use kitchen stock', 'Use garage stock'
    ],
                         validators=[DataRequired()])

    submit = SubmitField('Enter', validators=[DataRequired()])
Esempio n. 16
0
class RequestCabForm(FlaskForm):
    cab_code = IntegerField(u'barcode',
                            validators=[DataRequired()],
                            render_kw={
                                'class': HTMLclass_form_control,
                                'placeholder':
                                u"entrez le code barre de l'ouvrage ",
                                "onfocus": u"this.placeholder = ''"
                            })
    categ = RadioField(u'catΓ©gorie',
                       choices=[(key_parc_envies, u'envie de lire'),
                                (key_parc_lus, u'ouvrage lu')],
                       render_kw={'class': HTMLclass_radio_line},
                       default=key_parc_envies)
Esempio n. 17
0
class Data(FlaskForm):
    name = StringField('Name', validators=[DataRequired()])
    url = StringField('Geo-Link', validators=[DataRequired(), URL()])
    food_rating = SelectField(
        'Food πŸ•',
        choices=['πŸ•', 'πŸ•πŸ•', 'πŸ•πŸ•πŸ•', 'πŸ•πŸ•πŸ•πŸ•', 'πŸ•πŸ•πŸ•πŸ•πŸ•'],
        validators=[DataRequired(message="Please Choose rating")])
    spot_rating = SelectField(
        'Spot πŸ–οΈ',
        choices=['πŸ–οΈ', 'πŸ–οΈπŸ–οΈ', 'πŸ–οΈπŸ–οΈπŸ–οΈ', 'πŸ–οΈπŸ–οΈπŸ–οΈπŸ–οΈ', 'πŸ–οΈπŸ–οΈπŸ–οΈπŸ–οΈπŸ–οΈ'],
        validators=[DataRequired(message="Please Choose rating")])
    price_rating = RadioField(
        'Price πŸ’°',
        choices=['πŸ’°', 'πŸ’°πŸ’°', 'πŸ’°πŸ’°πŸ’°', 'πŸ’°πŸ’°πŸ’°πŸ’°', 'πŸ’°πŸ’°πŸ’°πŸ’°πŸ’°'],
        validators=[DataRequired(message="Please Choose rating")],
        validate_choice=True)
    submit = SubmitField("submit")
Esempio n. 18
0
class SearchRoomsForm(IndicoForm):
    location = QuerySelectField(_(u'Location'),
                                get_label=lambda x: x.name,
                                query_factory=Location.find,
                                allow_blank=True)
    details = StringField()
    available = RadioField(_(u'Availability'),
                           coerce=int,
                           default=-1,
                           widget=ConcatWidget(prefix_label=False),
                           choices=[(1, _(u'Available')), (0, _(u'Booked')),
                                    (-1, _(u"Don't care"))])
    capacity = IntegerField(_(u'Capacity'),
                            validators=[Optional(),
                                        NumberRange(min=0)])
    available_equipment = IndicoQuerySelectMultipleCheckboxField(
        _(u'Equipment'),
        get_label=_get_equipment_label,
        modify_object_list=_group_equipment,
        query_factory=lambda: EquipmentType.find().order_by(EquipmentType.name
                                                            ))
    is_only_public = BooleanField(_(u'Only public rooms'), default=True)
    is_auto_confirm = BooleanField(_(u'Only rooms not requiring confirmation'),
                                   default=True)
    is_only_active = BooleanField(_(u'Only active rooms'), default=True)
    is_only_my_rooms = BooleanField(_(u'Only my rooms'))
    # Period details when searching for (un-)availability
    start_dt = DateTimeField(_(u'Start date'),
                             validators=[Optional()],
                             parse_kwargs={'dayfirst': True},
                             display_format='%d/%m/%Y %H:%M',
                             widget=HiddenInput())
    end_dt = DateTimeField(_(u'End date'),
                           validators=[Optional()],
                           parse_kwargs={'dayfirst': True},
                           display_format='%d/%m/%Y %H:%M',
                           widget=HiddenInput())
    repeatability = StringField(
    )  # TODO: use repeat_frequency/interval with new UI
    include_pending_blockings = BooleanField(
        _(u'Check conflicts against pending blockings'), default=True)
    include_pre_bookings = BooleanField(
        _(u'Check conflicts against pre-bookings'), default=True)
Esempio n. 19
0
class UserCreateForm(FlaskForm):
    username = StringField(
        'μ‚¬μš©μž 이름',
        validators=[DataRequired("이름을 μž…λ ₯ν•΄μ£Όμ„Έμš”."),
                    Length(min=3, max=25)])
    nickname = StringField(
        'λ‹‰λ„€μž„',
        validators=[DataRequired("λ‹‰λ„€μž„μ„ μž…λ ₯ν•΄μ£Όμ„Έμš”."),
                    Length(min=2, max=12)])
    password1 = PasswordField('λΉ„λ°€λ²ˆν˜Έ',
                              validators=[
                                  DataRequired('λΉ„λ°€λ²ˆν˜Έλ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”.'),
                                  EqualTo('password2', 'λΉ„λ°€λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.')
                              ])
    password2 = PasswordField('λΉ„λ°€λ²ˆν˜Έ 확인',
                              validators=[DataRequired('λΉ„λ°€λ²ˆν˜Έλ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”.')])
    email = EmailField('이메일', [DataRequired('이메일을 μž…λ ₯ν•΄μ£Όμ„Έμš”.'), Email()])
    phone = StringField(
        'νœ΄λŒ€μ „ν™” 번호',
        validators=[DataRequired('μ „ν™”λ²ˆν˜Έλ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”.'),
                    Length(min=10, max=15)])
    gender = RadioField('성별',
                        validators=[DataRequired('성별을 μ„ νƒν•˜μ„Έμš”')],
                        choices=[("λ‚¨μž", 'λ‚¨μž'), ("μ—¬μž", 'μ—¬μž')])
Esempio n. 20
0
class TargetWeightForm(FlaskForm):
    sex = RadioField(label='Gender',choices=[('m',"β™‚ Male"),('f',"♀ Female")],default='m')
    age = IntegerField("Age (years)",widget=TelInput())
    bw = FloatField("Body Weight (lb)",widget=TelInput())
    movement = SelectField(
        "Barbell Movement",
        choices=[
            ('01','Front Squat'),
            ('02','Back Squat'),
            ('03','Overhead Squat'),
            ('04','Clean (Squat Clean)'),
            ('05','Power Clean'),
            ('06','Clean & Jerk'),
            ('07','Deadlift'),
            ('08','Snatch (Squat Snatch)'),
            ('09','Power Snatch'),
            ('10','Strict Press'),
            ('11','Push Press'),
            ('12','Push Jerk'),
            ('13','Thruster'),
            ('14','Bench Press'),
            ]
    )
    submit = SubmitField("Calculate")
Esempio n. 21
0
class data (Form):
    breathing_problem = RadioField("Apakah anda mengalami gangguan pernapasan?", choices=[
                                   ('Y', 'Ya'), ('T', 'Tidak')])
    fever = RadioField("Apakah anda mengalami demam (suhu >38 derajat)?", choices=[
                       ('Y', 'Ya'), ('T', 'Tidak')])
    dry_cough = RadioField("Apakah anda mengalami batuk kering?", choices=[
                           ('Y', 'Ya'), ('T', 'Tidak')])
    sore_throat = RadioField("Apakah anda mengalami sakit tenggorokan?", choices=[
                             ('Y', 'Ya'), ('T', 'Tidak')])
    running_nose = RadioField("Apakah anda mengalami hidung berair", choices=[
                              ('Y', 'Ya'), ('T', 'Tidak')])
    asthma = RadioField("Apakah anda memiliki riwayat penyakit asma?", choices=[
                        ('Y', 'Ya'), ('T', 'Tidak')])
    cronicc_lung_disease = RadioField(
        "Apakah anda memiliki riwayat penyakit paru-paru kronis?", choices=[('Y', 'Ya'), ('T', 'Tidak')])
    headache = RadioField("Apakah anda mengalami sakit kepala?", choices=[
                          ('Y', 'Ya'), ('T', 'Tidak')])
    heart_disease = RadioField("Apakah anda memiliki penyakit jantung?", choices=[
                               ('Y', 'Ya'), ('T', 'Tidak')])
    diabetes = RadioField("Apakah anda memiliki riwayat penyakit diabetes?", choices=[
                          ('Y', 'Ya'), ('T', 'Tidak')])
    hypertension = RadioField("Apakah anda memiliki hipertensi (darah tinggi)", choices=[
                              ('Y', 'Ya'), ('T', 'Tidak')])
    fatigue = RadioField("Apakah anda merasa kelelahan?",
                         choices=[('Y', 'Ya'), ('T', 'Tidak')])
    gastro = RadioField("Apakah anda memiliki masalah pencernaan atau lambung?", choices=[
                        ('Y', 'Ya'), ('T', 'Tidak')])
    abroad_travel = RadioField("Apakah anda dalam waktu 14 hari ini melakukan perjalanan keluar negeri?", choices=[
                               ('Y', 'Ya'), ('T', 'Tidak')])
    contact = RadioField("Apakah anda pernah melakukan kontak dengan seorang pengidap COVID dalam waktu 14 hari ini?", choices=[
                         ('Y', 'Ya'), ('T', 'Tidak')])
    attend_large_gath = RadioField("Apakah dalam waktu 14 hari ini anda menghadiri pertemuan yang dihari oleh banyak orang? ", choices=[
                                   ('Y', 'Ya'), ('T', 'Tidak')])
    visited_public = RadioField("Apakah dalam waktu 14 hari ini anda mengunjungi tempat publik?", choices=[
                                ('Y', 'Ya'), ('T', 'Tidak')])
    fams_working_in_pub = RadioField(
        "Apakah ada keluarga anda yang bekerja di tempat umum?", choices=[('Y', 'Ya'), ('T', 'Tidak')])
    wearing_mask = RadioField("Apakah anda tetap menggunakan masker?", choices=[
                              ('Y', 'Ya'), ('T', 'Tidak')])
    sanitation_from_market = RadioField(
        "Apakah anda membersikan/sanitize barang-barang yang dibeli dari supermarket?", choices=[('Y', 'Ya'), ('T', 'Tidak')])

    kirim = SubmitField("Kirim")
Esempio n. 22
0
class QuestionForm(FlaskForm):
    """Question Form."""
    answers = RadioField('Select from:', choices=[])
Esempio n. 23
0
class PreflopForm(Form):  # IGNORE:R0924
    """
    User chooses a preflop situation.
    """
    situationid = RadioField(default='1', validators=[Required()])
Esempio n. 24
0
class VenueForm(Form):
    name = StringField('name', validators=[DataRequired()])
    city = StringField('city', validators=[DataRequired()])
    state = SelectField('state',
                        validators=[DataRequired()],
                        choices=[
                            ('AL', 'AL'),
                            ('AK', 'AK'),
                            ('AZ', 'AZ'),
                            ('AR', 'AR'),
                            ('CA', 'CA'),
                            ('CO', 'CO'),
                            ('CT', 'CT'),
                            ('DE', 'DE'),
                            ('DC', 'DC'),
                            ('FL', 'FL'),
                            ('GA', 'GA'),
                            ('HI', 'HI'),
                            ('ID', 'ID'),
                            ('IL', 'IL'),
                            ('IN', 'IN'),
                            ('IA', 'IA'),
                            ('KS', 'KS'),
                            ('KY', 'KY'),
                            ('LA', 'LA'),
                            ('ME', 'ME'),
                            ('MT', 'MT'),
                            ('NE', 'NE'),
                            ('NV', 'NV'),
                            ('NH', 'NH'),
                            ('NJ', 'NJ'),
                            ('NM', 'NM'),
                            ('NY', 'NY'),
                            ('NC', 'NC'),
                            ('ND', 'ND'),
                            ('OH', 'OH'),
                            ('OK', 'OK'),
                            ('OR', 'OR'),
                            ('MD', 'MD'),
                            ('MA', 'MA'),
                            ('MI', 'MI'),
                            ('MN', 'MN'),
                            ('MS', 'MS'),
                            ('MO', 'MO'),
                            ('PA', 'PA'),
                            ('RI', 'RI'),
                            ('SC', 'SC'),
                            ('SD', 'SD'),
                            ('TN', 'TN'),
                            ('TX', 'TX'),
                            ('UT', 'UT'),
                            ('VT', 'VT'),
                            ('VA', 'VA'),
                            ('WA', 'WA'),
                            ('WV', 'WV'),
                            ('WI', 'WI'),
                            ('WY', 'WY'),
                        ])
    address = StringField('address', validators=[DataRequired()])
    phone = StringField('phone')
    image_link = StringField('image_link')
    genres = SelectMultipleField(
        # TODO implement enum restriction
        'genres',
        validators=[DataRequired()],
        choices=[
            ('Alternative', 'Alternative'),
            ('Blues', 'Blues'),
            ('Classical', 'Classical'),
            ('Country', 'Country'),
            ('Electronic', 'Electronic'),
            ('Folk', 'Folk'),
            ('Funk', 'Funk'),
            ('Hip-Hop', 'Hip-Hop'),
            ('Heavy Metal', 'Heavy Metal'),
            ('Instrumental', 'Instrumental'),
            ('Jazz', 'Jazz'),
            ('Musical Theatre', 'Musical Theatre'),
            ('Pop', 'Pop'),
            ('Punk', 'Punk'),
            ('R&B', 'R&B'),
            ('Reggae', 'Reggae'),
            ('Rock n Roll', 'Rock n Roll'),
            ('Soul', 'Soul'),
            ('Other', 'Other'),
        ])
    facebook_link = StringField('facebook_link', validators=[URL()])

    website = StringField('website', validators=[URL()])

    seeking_talent = RadioField('seeking_talent',
                                validators=[URL()],
                                choices=[('true', 'Yes'), ('false', 'No')])
    seeking_description = StringField('seeking_description',
                                      validators=[URL()])
Esempio n. 25
0
class LifterProfileForm(FlaskForm):
    sex = RadioField(label="Gender",choices=[('m',"β™‚ Male"),('f',"♀ Female")])
    name = StringField("Name")
    age = IntegerField("Age (years)",widget=TelInput())
    bw = FloatField("Body Weight (lb)",widget=TelInput())
    submit = SubmitField("Save Profile")
Esempio n. 26
0
class ArtistForm(Form):
    name = StringField("name", validators=[DataRequired()])
    city = StringField("city", validators=[DataRequired()])
    state = SelectField(
        "state",
        validators=[DataRequired()],
        choices=[
            ("AL", "AL"),
            ("AK", "AK"),
            ("AZ", "AZ"),
            ("AR", "AR"),
            ("CA", "CA"),
            ("CO", "CO"),
            ("CT", "CT"),
            ("DE", "DE"),
            ("DC", "DC"),
            ("FL", "FL"),
            ("GA", "GA"),
            ("HI", "HI"),
            ("ID", "ID"),
            ("IL", "IL"),
            ("IN", "IN"),
            ("IA", "IA"),
            ("KS", "KS"),
            ("KY", "KY"),
            ("LA", "LA"),
            ("ME", "ME"),
            ("MT", "MT"),
            ("NE", "NE"),
            ("NV", "NV"),
            ("NH", "NH"),
            ("NJ", "NJ"),
            ("NM", "NM"),
            ("NY", "NY"),
            ("NC", "NC"),
            ("ND", "ND"),
            ("OH", "OH"),
            ("OK", "OK"),
            ("OR", "OR"),
            ("MD", "MD"),
            ("MA", "MA"),
            ("MI", "MI"),
            ("MN", "MN"),
            ("MS", "MS"),
            ("MO", "MO"),
            ("PA", "PA"),
            ("RI", "RI"),
            ("SC", "SC"),
            ("SD", "SD"),
            ("TN", "TN"),
            ("TX", "TX"),
            ("UT", "UT"),
            ("VT", "VT"),
            ("VA", "VA"),
            ("WA", "WA"),
            ("WV", "WV"),
            ("WI", "WI"),
            ("WY", "WY"),
        ],
    )
    phone = StringField(
        # TODO implement validation logic for state
        # I dont know how to do?
        # Could you please help?
        "phone"
    )
    image_link = StringField("image_link")
    genres = SelectMultipleField(
        # DONE implement enum restriction
        "genres",
        validators=[DataRequired()],
        choices=[(genre, genre.name) for genre in MusicGenre],
    )
    facebook_link = StringField(
        # TODO implement enum restriction
        # I dont know how to do?
        # Could you please help?
        "facebook_link",
        validators=[URL()],
    )
    seeking_venue = RadioField(
        "seeking_venue",
        validators=[DataRequired()],
        choices=[(True, "Yes"), (False, "No")],
    )
    seeking_description = StringField(
        "seeking_description",
    )
Esempio n. 27
0
class OpenGamesForm(Form):  # IGNORE:R0924
    """
    User chooses an open game to join.
    """
    gameid = RadioField(validators=[Required()])
Esempio n. 28
0
class UpdateProfile(FlaskForm):
    bio = TextAreaField('Tell us about you.', validators=[Required()])
    DOB = DateField('DOB', format='%Y-%m-%d')
    MF = RadioField('Gender', choices=[('M', 'Male'), ('F', 'Female')])
    submit = SubmitField('Submit')
Esempio n. 29
0
class TextureForm(Form):  #IGNORE:R0924
    """
    User chooses a postflop situation texture.
    """
    texture = RadioField(default='random', validators=[Required()])
Esempio n. 30
0
        return cls.QRFormat.format(crypt=dict['crypt'],
                                   ssid=dict['ssid'],
                                   passwd=dict['passwd'],
                                   hidden=hidden)

    ssid = StringField(label='SSID',
                       validators=[InputRequired()],
                       render_kw={'placeholder': 'My Wi-Fi network'})

    ssid_hidden = BooleanField(label='Hidden network', default=False)

    crypt = RadioField(
        label='Network cryptography',
        choices=[
            ('WEP', 'WEP'),
            ('WPA', 'WPA (default)'),
            # ('WPA2-EAP', 'WPA2-EAP'),
            ('nopass', 'None')
        ],
        default='WPA',
    )

    passwd = PasswordField(
        label='Password',
        render_kw={'placeholder': 'MyPass123 (optional)'},
    )


class EventQRCodeForm(CustomFlaskForm):
    name = 'Event QR'
    QRFormat = \
        """