Beispiel #1
0
class UpdateTrain(FlaskForm):
    trainName = StringField('Train Name', validators=[DataRequired()])
    trainID = StringField('Train ID',
                          validators=[DataRequired(),
                                      Length(min=6, max=6)])
    starting = StringField('Starting Station', validators=[DataRequired()])
    ending = StringField('Ending Station', validators=[DataRequired()])
    monday = BooleanField('Monday')
    tuesday = BooleanField('Tuesday')
    wednesday = BooleanField('Wednesday')
    thursday = BooleanField('Thursday')
    friday = BooleanField('Friday')
    saturday = BooleanField('Saturday')
    sunday = BooleanField('Sunday')
    acFirstClassCoaches = StringField('No. of AC First Class Coaches ',
                                      validators=[DataRequired()])
    acFirstClassFare = StringField('AC First Class Fare',
                                   validators=[DataRequired()])
    acTwoTierCoaches = StringField('No. of AC 2 Tier Coaches',
                                   validators=[DataRequired()])
    acTwoTierFare = StringField('AC 2 Tier Fare', validators=[DataRequired()])
    acThreeTierCoaches = StringField('No. of AC 3 Tier Coaches',
                                     validators=[DataRequired()])
    acThreeTierFare = StringField('AC 3 Tier Fare',
                                  validators=[DataRequired()])
    sleeperClassCoaches = StringField('No. of Slepper Class Coaches',
                                      validators=[DataRequired()])
    sleeperClassFare = StringField('Sleeper Class Fare',
                                   validators=[DataRequired()])
    departure = TimeField('Departure Time', validators=[DataRequired()])
    arrival = TimeField('Arrival Time', validators=[DataRequired()])
    total = TimeField('Total Time', validators=[DataRequired()])
    submit = SubmitField('Update Train')
Beispiel #2
0
class _DateTimePair(IndicoForm):
    class Meta:
        csrf = False

    start_date = IndicoDateField(
        _(u'from'), [UsedIf(lambda form, field: form.end_date.data)])
    start_time = TimeField(None, [Optional()])
    end_date = IndicoDateField(
        _(u'to'), [UsedIf(lambda form, field: form.start_date.data)])
    end_time = TimeField(None, [Optional()])

    @property
    def start_dt(self):
        if self.start_date.data:
            return datetime.combine(self.start_date.data, self.start_time.data)
        else:
            return None

    @property
    def end_dt(self):
        if self.end_date.data:
            return datetime.combine(self.end_date.data, self.end_time.data)
        else:
            return None

    def validate_start(self, field):
        if self.start_dt and self.end_dt and self.start_dt >= self.end_dt:
            raise ValidationError(
                'The start date must be earlier than the end date.')

    validate_end = validate_start
class UploadForm(FlaskForm):
    subject = StringField('Subject')
    topic = StringField('Topic')
    doc = FileField('CSV Upload', validators=[FileRequired()])
    start_date = DateField('Start Date')
    start_time = TimeField('Start Time',
                           default=datetime.utcnow() + timedelta(hours=5.5))
    end_date = DateField('End Date')
    end_time = TimeField('End Time',
                         default=datetime.utcnow() + timedelta(hours=5.5))
    password = StringField('Test Password', [validators.Length(min=3, max=6)])

    def validate_end_date(form, field):
        if field.data < form.start_date.data:
            raise ValidationError(
                "End date must not be earlier than start date.")

    def validate_end_time(form, field):
        start_date_time = datetime.strptime(
            str(form.start_date.data) + " " + str(form.start_time.data),
            "%Y-%m-%d %H:%M:%S").strftime("%Y-%m-%d %H:%M")
        end_date_time = datetime.strptime(
            str(form.end_date.data) + " " + str(field.data),
            "%Y-%m-%d %H:%M:%S").strftime("%Y-%m-%d %H:%M")
        if start_date_time >= end_date_time:
            raise ValidationError(
                "End date time must not be earlier/equal than start date time")

    def validate_start_date(form, field):
        if datetime.strptime(
                str(form.start_date.data) + " " + str(form.start_time.data),
                "%Y-%m-%d %H:%M:%S") < datetime.now():
            raise ValidationError(
                "Start date and time must not be earlier than current")
class GeneralForm(FlaskForm):
    add_dep = StringField('Adresse de départ :', validators=[DataRequired()])
    dep_home = BooleanField('Partir de votre domicile')
    add_arr = StringField('Adresse d\'arrivée :', validators=[DataRequired()])
    """
    tags = SelectMultipleField('Tags', choices=Tags(TAGS))"""
    locomotion = RadioField('Locomotion :',
                            choices=[('driving', 'Voiture'),
                                     ('transit', 'Transports en commun'),
                                     ('walking', 'A pied')])
    optimisation = RadioField('Optimisation :',
                              choices=[('distance', 'Distance'),
                                       ('time', 'Temps'),
                                       ('affinity', 'Affinités')])
    h_dep = TimeField('Heure de départ :')
    j_dep = DateField('Jour de départ :')
    h_arr = TimeField('Heure d\'arrivée :')
    j_arr = DateField('Jour d\'arrivée :')
    max_escales = SelectField('Nombre d\'escales souhaité :',
                              choices=[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4),
                                       (5, 5)])
    escales = TextField('Escales :')
    t_max = RadioField('Durée maximale sans pause :',
                       choices=[(0, 'Sans pause'), (3600, '1h00'),
                                (7200, '2h00'), (10800, '3h00')])
    d_max = RadioField('Distance maximale sans pause:',
                       choices=[(0, 'Sans pause'), (100000, '100km'),
                                (20000, '200km'), (300000, '300km')])
    submit = SubmitField('Valider')


###############################################################################
Beispiel #5
0
class DowntimeBarForm(FlaskForm):
    form_template = "key_date_time"
    graph_name = "Downtime Bar Chart"
    description = "A bar chart showing the total amount of each activity for selected machines between two times"
    key = SelectField(validators=[
        NoneOf(MACHINES_CHOICES_HEADERS, message="Pick a machine or group")
    ],
                      id="downtime_bar_machines")
    start_date = DateField(validators=[DataRequired()],
                           format=DATE_FORMAT,
                           id="downtime_bar_start_date",
                           label="Start Date (DD-MM-YYYY)",
                           default=datetime.now())
    end_date = DateField(validators=[DataRequired()],
                         format=DATE_FORMAT,
                         id="downtime_bar_end_date",
                         label="End Date (DD-MM-YYYY)",
                         default=datetime.now() + timedelta(days=1))
    start_time = TimeField(validators=[DataRequired()],
                           format=TIME_FORMAT,
                           default=midnight,
                           id="downtime_bar_start_time")
    end_time = TimeField(validators=[DataRequired()],
                         format=TIME_FORMAT,
                         default=midnight,
                         id="downtime_bar_end_time")

    submit = SubmitField('Submit', id="downtime_bar_submit")
Beispiel #6
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')
Beispiel #7
0
class RequestForm(Form):
    pass_no = IntegerField('Passenger Number', validators=[DataRequired()])
    lat_A = FloatField('Lat A', validators=[DataRequired()])
    lon_A = FloatField('Lon A', validators=[DataRequired()])
    lat_B = FloatField('Lat B', validators=[DataRequired()])
    lon_B = FloatField('Lon B', validators=[DataRequired()])
    w3w_A1 = StringField('W3WA1', validators=[DataRequired()])
    w3w_A2 = StringField('W3WA2', validators=[DataRequired()])
    w3w_A3 = StringField('W3WA3', validators=[DataRequired()])
    w3w_B1 = StringField('W3WB1', validators=[DataRequired()])
    w3w_B2 = StringField('W3WB2', validators=[DataRequired()])
    w3w_B3 = StringField('W3WB3', validators=[DataRequired()])
    monday = BooleanField('Monday')
    tuesday = BooleanField('Tuesday')
    wednesday = BooleanField('Wednesday')
    thursday = BooleanField('Thursday')
    friday = BooleanField('Friday')
    saturday = BooleanField('Saturday')
    Sunday = BooleanField('Sunday')
    once_off = BooleanField('Once-off')
    rep_weekly = BooleanField('Weekly')
    rep_biweekly = BooleanField('Bi-weekly')
    rep_monthly = BooleanField('Monthly')
    start_date = DateField('Start', validators=[DataRequired()])
    end_date = DateField('End', validators=[DataRequired()])
    departure_1 = TimeField('Departure 1', validators=[DataRequired()])
    departure_2 = TimeField('Departure 2', validators=[DataRequired()])
    arrival_1 = TimeField('Arrival 1', validators=[DataRequired()])
    arrival_2 = TimeField('Arrival 2', validators=[DataRequired()])
    phone = StringField('Phone', validators=[DataRequired()])
Beispiel #8
0
class SettingsForm(FlaskForm):
    # field1 = SelectField('Device', choices=[('1', 'Bathroom'), ('2', 'Steps')], validators=[DataRequired()])
    device = SelectMultipleField('Light',
                                 choices=[('1', 'Bathroom'), ('2', 'Steps'),
                                          ('3', 'Kitchen')],
                                 option_widget=widgets.CheckboxInput(),
                                 widget=widgets.ListWidget(prefix_label=False))
    on_time = TimeField('On Time', default=datetime.time(17, 0))
    low_time = TimeField('Low Time', default=datetime.time(23, 30))
    off_time = TimeField('Off Time', default=datetime.time(7, 30))
    low = IntegerField('Low Light Setting (0-100)',
                       default=30,
                       validators=[
                           DataRequired(),
                           NumberRange(min=0,
                                       max=100,
                                       message='Values from 0-100')
                       ])
    high = IntegerField('High Light Setting (0-100)',
                        default=75,
                        validators=[
                            DataRequired(),
                            NumberRange(min=0,
                                        max=100,
                                        message='Values from 0-100')
                        ])
    manual = IntegerField('Manual Light Setting (0-100)',
                          default=100,
                          validators=[
                              DataRequired(),
                              NumberRange(min=0,
                                          max=100,
                                          message='Values from 0-100')
                          ])
    submit = SubmitField('Submit')
Beispiel #9
0
class EventForm(FlaskForm):
    title = StringField('Title', validators=[DataRequired()])
    description = TextAreaField('Description',
                                validators=[Length(min=1, max=240)])
    hyperlink = StringField('Link',
                            validators=[Length(min=1, max=240),
                                        Optional()])
    start_date = DateField('Start Date',
                           format="%Y-%m-%d",
                           default=datetime.today,
                           validators=[DataRequired()])
    start_time = TimeField('Start Time',
                           format="%H:%M",
                           default=datetime.now,
                           validators=[Optional()])
    end_date = DateField('End Date',
                         format="%Y-%m-%d",
                         validators=[Optional()])
    end_time = TimeField('End Time', format="%H:%M", validators=[Optional()])
    address = StringField('Address', validators=[Optional()])
    zipcode = IntegerField('Zipcode',
                           validators=[DataRequired(), validate_zipcode])
    category = SelectField('Category',
                           choices=[('general', 'General'),
                                    ('sport', 'Sports'), ('family', 'Family'),
                                    ('social', 'Social'),
                                    ('cultural', 'Cultural')],
                           default='general')
    submit = SubmitField('Register')
Beispiel #10
0
class BookingSearchForm(IndicoForm):
    room_ids = SelectMultipleField('Rooms', [DataRequired()], coerce=int)

    start_date = DateField('Start Date', [InputRequired()],
                           parse_kwargs={'dayfirst': True})
    start_time = TimeField('Start Time', [InputRequired()])
    end_date = DateField('End Date', [InputRequired()],
                         parse_kwargs={'dayfirst': True})
    end_time = TimeField('End Time', [InputRequired()])

    booked_for_name = StringField('Booked For Name')
    reason = StringField('Reason')

    is_only_mine = BooleanField('Only Mine')
    is_only_my_rooms = BooleanField('Only My Rooms')
    is_only_confirmed_bookings = BooleanField('Only Confirmed Bookings')
    is_only_pending_bookings = BooleanField('Only Prebookings')

    is_rejected = BooleanField('Is Rejected')
    is_cancelled = BooleanField('Is Cancelled')
    is_archived = BooleanField('Is Archived')

    uses_vc = BooleanField(_('Uses Videoconference'))
    needs_vc_assistance = BooleanField(_('Videoconference Setup Assistance'))
    needs_assistance = BooleanField('General Assistance')

    @generated_data
    def start_dt(self):
        return datetime.combine(self.start_date.data, self.start_time.data)

    @generated_data
    def end_dt(self):
        return datetime.combine(self.end_date.data, self.end_time.data)
Beispiel #11
0
class ActivityDurationsTableForm(FlaskForm):
    form_template = "key_date_time"
    graph_name = "Activity Durations Table"
    key = SelectField(validators=[DataRequired()],
                      choices=[("users", "Users"), ("machines", "Machines")])
    start_time = TimeField(validators=[DataRequired()],
                           format=TIME_FORMAT,
                           default=midnight,
                           id="activity_table_start_time")
    end_time = TimeField(validators=[DataRequired()],
                         format=TIME_FORMAT,
                         default=midnight,
                         id="activity_table_end_time")
    start_date = DateField(validators=[DataRequired()],
                           format=DATE_FORMAT,
                           id="activity_table_start_date",
                           label="Start Date (DD-MM-YYYY)",
                           default=datetime.now())
    end_date = DateField(validators=[DataRequired()],
                         format=DATE_FORMAT,
                         id="activity_table_end_date",
                         label="End Date (DD-MM-YYYY)",
                         default=datetime.now() + timedelta(days=1))

    submit = SubmitField('Submit', id="activity_table_submit")
Beispiel #12
0
class ScheduleForm(FlaskForm):
    event = SelectField('Events',
                        choices=[('Rubik\'s Cube', 'Rubik\'s Cube'),
                                 ('2x2x2 Cube', '2x2x2 Cube'),
                                 ('4x4x4 Cube', '4x4x4 Cube'),
                                 ('5x5x5 Cube', '5x5x5 Cube'),
                                 ('6x6x6 Cube', '6x6x6 Cube'),
                                 ('7x7x7 Cube', '7x7x7 Cube'),
                                 ('3x3x3 Blindfolded', '3x3x3 Blindfolded'),
                                 ('3x3x3 Fewest Moves', '3x3x3 Fewest Moves'),
                                 ('3x3x3 One Handed', '3x3x3 One Handed'),
                                 ('3x3x3 With Feet', '3x3x3 With Feet'),
                                 ('Megaminx', 'Megaminx'),
                                 ('Pyraminx', 'Pyraminx'),
                                 ('Rubik\'s Clock', 'Rubik\'s Clock'),
                                 ('Skewb', 'Skewb'), ('Square-1', 'Square-1'),
                                 ('4x4x4 Blindfolded', '4x4x4 Blindfolded'),
                                 ('5x5x5 Blindfolded', '5x5x5 Blindfolded'),
                                 ('3x3x3 Multi-Blind', '3x3x3 Multi-Blind'),
                                 ('Other', 'Other')])
    event_round = SelectField('Round',
                              choices=[('Round 1', 'Round 1'),
                                       ('Round 2', 'Round 2'),
                                       ('Final', 'Final'),
                                       ('Combined Final', 'Combined Final')])
    start_time = TimeField('Start time', format='%H:%M')
    end_time = TimeField('End time', format='%H:%M')
    submit = SubmitField('Create competition')
Beispiel #13
0
class GanttForm(FlaskForm):
    form_template = "key_date_time"
    graph_name = "Machine Status Gantt Chart"
    description = "A Gantt chart showing the activity of a single machine or multiple machines. Time is plotted on the x-axis and different " \
                  "colours represent different activities."
    key = SelectField(validators=[
        NoneOf(MACHINES_CHOICES_HEADERS, message="Pick a machine or group")
    ],
                      id="gantt_machines")
    start_date = DateField(validators=[DataRequired()],
                           format=DATE_FORMAT,
                           label="Start Date (DD-MM-YYYY)",
                           default=datetime.now())
    end_date = DateField(validators=[DataRequired()],
                         format=DATE_FORMAT,
                         label="End Date (DD-MM-YYYY)",
                         default=datetime.now() + timedelta(days=1))
    start_time = TimeField(validators=[DataRequired()],
                           format=TIME_FORMAT,
                           default=midnight,
                           id="gantt_start_time")
    end_time = TimeField(validators=[DataRequired()],
                         format=TIME_FORMAT,
                         default=midnight,
                         id="gantt_end_time")

    submit = SubmitField('Submit', id="gantt_submit")
Beispiel #14
0
class ItineraryForm(Form):
    date = DateField('Date', format='%Y-%m-%d')
    start_time = TimeField('Start Time')
    end_time = TimeField('End Time')
    driver_id = SelectField(u'Driver', choices=[])
    trolley_id = SelectField(u'Trolley', choices=[])
    route_id = SelectField(u'Route', choices=[])
Beispiel #15
0
class ReusableForm(FlaskForm):
    add_dep = StringField('Adresse de départ :', validators=[DataRequired()])
    add_arr = StringField('Adresse d\'arrivée :', validators=[DataRequired()])
    #tags=StringField('Tags :', validators=[DataRequired()])
    tags = SelectMultipleField('Tags', choices=Tags(TAGS))
    locomotion = RadioField('Locomotion :',
                            choices=[('driving', 'Voiture'),
                                     ('transit', 'Transports en commun'),
                                     ('walking', 'A pied')])
    optimisation = RadioField('Optimisation :',
                              choices=[('distance', 'Distance'),
                                       ('time', 'Temps'),
                                       ('affinity', 'Affinités')])
    h_dep = TimeField('Heure de départ :')
    j_dep = TimeField('Jour de départ :')
    h_arr = TimeField('Heure d\'arrivée :')
    j_arr = TimeField('Jour d\'arrivée :')
    escales = TextField('Escales :')
    t_max = RadioField('Durée maximale sans pause :',
                       choices=[(3600, '1h00'), (7200, '2h00'),
                                (10800, '3h00')])
    t_repas = RadioField('Durée maximale du repas :'******'15 min'), (1800, '30 min'),
                                  (3600, '1h00')])
    submit = SubmitField('Valider')
Beispiel #16
0
class UploadForm(Form):
	subject = TextField('Subject', validators=[DataRequired()])
	topic = TextField('Topic', validators=[DataRequired()])
	start_date = DateField('Start Date', validators=[DataRequired()])
	start_time = TimeField('Start Time', default=datetime.utcnow()+timedelta(hours=5.5), validators=[DataRequired()])
	end_date = DateField('End Date', validators=[DataRequired()])
	end_time = TimeField('End Time', default=datetime.utcnow()+timedelta(hours=6.5), validators=[DataRequired()])
	show_result = BooleanField('Show Result after completion', validators=[DataRequired()])
	neg_mark = BooleanField('Enable negative marking', validators=[DataRequired()])
	duration = TextField('Duration(in min)', validators=[DataRequired()])
	password = TextField('Test Password', validators=[DataRequired()])

	def validate_end_date(form, field):
		if field.data < form.start_date.data:
			raise ValidationError("End date must not be earlier than start date.")
	
	def validate_end_time(form, field):
		start_date_time = datetime.strptime(str(form.start_date.data) + " " + str(form.start_time.data),"%Y-%m-%d %H:%M:%S").strftime("%Y-%m-%d %H:%M")
		end_date_time = datetime.strptime(str(form.end_date.data) + " " + str(field.data),"%Y-%m-%d %H:%M:%S").strftime("%Y-%m-%d %H:%M")
		if start_date_time >= end_date_time:
			raise ValidationError("End date time must not be earlier/equal than start date time")
	
	def validate_start_date(form, field):
		if datetime.strptime(str(form.start_date.data) + " " + str(form.start_time.data),"%Y-%m-%d %H:%M:%S") < datetime.now():
			raise ValidationError("Start date and time must not be earlier than current")
Beispiel #17
0
class Cadastro(FlaskForm):
    nome = StringField('nome')
    script = StringField('script Python')
    period = IntegerField('Intervalo em minutos')
    iniciaja = BooleanField('Rodar ao cadastrar')
    horafim = TimeField('Encerrar execução às')
    horaini = TimeField('Iniciar execução às')
    submit = SubmitField('Cadastrar')
class SearchForm(FlaskForm):
    Pickingup = SelectField("Picking up", choices=myChoices2)
    Dropoff = SelectField("Dropping off", choices=myChoices2)
    Pickupdate = DateField("Pickup Date", validators=[Required()])
    Pickuptime = TimeField("Pickup Time", validators=[Required()])
    Dropoffdate = DateField("Dropoff Date", validators=[Required()])
    Dropofftime = TimeField("Dropoff Time", validators=[Required()])
    submit = SubmitField('Search')
Beispiel #19
0
class UpdateEventForm(FlaskForm):
	title = StringField('Title', validators=[DataRequired()])
	date = DateField('Date', format='%Y-%m-%d', validators=[DataRequired()])
	start_time = TimeField('Start Time', validators=[DataRequired()])
	end_time = TimeField('End Time', validators=[DataRequired()])
	location = StringField('Location')
	notes = TextAreaField('Notes', validators=[Length(min=0, max=140)])
	submit = SubmitField('Send')
Beispiel #20
0
class NewEventForm(FlaskForm):
	title = StringField('Title', validators=[DataRequired()])
	date = DateField('Date', format='%Y-%m-%d', validators=[DataRequired()], render_kw={"placeholder": "yyyy-mm-dd"})
	start_time = TimeField('Start Time', validators=[DataRequired()], render_kw={"placeholder": "hh:mm"})
	end_time = TimeField('End Time', validators=[DataRequired()], render_kw={"placeholder": "hh:mm"})
	location = StringField('Location')
	notes = TextAreaField('Notes', validators=[Length(min=0, max=140)])
	submit = SubmitField('Send')
class ShiftForm(FlaskForm):
    name = StringField('Shift name:', validators=[DataRequired()])
    start = TimeField('Start Time:', validators=[DataRequired()])
    end = TimeField('End Time', validators=[DataRequired()])
    holidays = StringField('Holidays')
    Add = SubmitField('Add')
    Delete = SubmitField('Delete')
    Edit = SubmitField('Edit')
Beispiel #22
0
class FlightDetailsForm(flask_wtf.FlaskForm):	
	airlines = [
		'AA', 'AS', 'B6', 'DL', 'F9', 'HA', 'NK', 'EV', 'OO', 'UA', 'VX', 'WN'
	]	
	airports = [
		'ABE', 'ABI', 'ABQ', 'ABR', 'ABY', 'ACK', 'ACT', 'ACV', 'ACY', 'ADK',
		'ADQ', 'AEX', 'AGS', 'AKN', 'ALB', 'AMA', 'ANC', 'APN', 'ASE', 'ATL',
		'ATW', 'AUS', 'AVL', 'AVP', 'AZO', 'BDL', 'BET', 'BFL', 'BGM', 'BGR',
		'BHM', 'BIL', 'BIS', 'BJI', 'BLI', 'BMI', 'BNA', 'BOI', 'BOS', 'BPT',
		'BQK', 'BQN', 'BRD', 'BRO', 'BRW', 'BTM', 'BTR', 'BTV', 'BUF', 'BUR',
		'BWI', 'BZN', 'CAE', 'CAK', 'CDC', 'CDV', 'CHA', 'CHO', 'CHS', 'CID',
		'CIU', 'CLE', 'CLL', 'CLT', 'CMH', 'CMX', 'COD', 'COS', 'CPR', 'CRP',
		'CRW', 'CSG', 'CVG', 'CWA', 'DAB', 'DAL', 'DAY', 'DCA', 'DEN', 'DFW',
		'DHN', 'DLG', 'DLH', 'DRO', 'DSM', 'DTW', 'DVL', 'EAU', 'ECP', 'EFD',
		'EGE', 'EKO', 'ELM', 'ELP', 'ERI', 'ESC', 'EUG', 'EVV', 'EWN', 'EWR',
		'EYW', 'FAI', 'FAR', 'FAT', 'FAY', 'FCA', 'FLG', 'FLL', 'FNT', 'FSD',
		'FSM', 'FWA', 'GCC', 'GCK', 'GEG', 'GFK', 'GGG', 'GJT', 'GNV', 'GPT',
		'GRB', 'GRI', 'GRK', 'GRR', 'GSO', 'GSP', 'GST', 'GTF', 'GTR', 'GUC',
		'GUM', 'HDN', 'HIB', 'HLN', 'HNL', 'HOB', 'HOU', 'HPN', 'HRL', 'HSV',
		'HYA', 'HYS', 'IAD', 'IAG', 'IAH', 'ICT', 'IDA', 'ILM', 'IMT', 'IND',
		'INL', 'ISN', 'ISP', 'ITH', 'ITO', 'JAC', 'JAN', 'JAX', 'JFK', 'JLN',
		'JMS', 'JNU', 'KOA', 'KTN', 'LAN', 'LAR', 'LAS', 'LAW', 'LAX', 'LBB',
		'LBE', 'LCH', 'LEX', 'LFT', 'LGA', 'LGB', 'LIH', 'LIT', 'LNK', 'LRD',
		'LSE', 'LWS', 'MAF', 'MBS', 'MCI', 'MCO', 'MDT', 'MDW', 'MEI', 'MEM',
		'MFE', 'MFR', 'MGM', 'MHK', 'MHT', 'MIA', 'MKE', 'MKG', 'MLB', 'MLI',
		'MLU', 'MMH', 'MOB', 'MOT', 'MQT', 'MRY', 'MSN', 'MSO', 'MSP', 'MSY',
		'MTJ', 'MVY', 'MYR', 'OAJ', 'OAK', 'OGG', 'OKC', 'OMA', 'OME', 'ONT',
		'ORD', 'ORF', 'ORH', 'OTH', 'OTZ', 'PAH', 'PBG', 'PBI', 'PDX', 'PGD',
		'PHF', 'PHL', 'PHX', 'PIA', 'PIB', 'PIH', 'PIT', 'PLN', 'PNS', 'PPG',
		'PSC', 'PSE', 'PSG', 'PSP', 'PVD', 'PWM', 'RAP', 'RDD', 'RDM', 'RDU',
		'RHI', 'RIC', 'RKS', 'RNO', 'ROA', 'ROC', 'ROW', 'RST', 'RSW', 'SAF',
		'SAN', 'SAT', 'SAV', 'SBA', 'SBN', 'SBP', 'SCC', 'SCE', 'SDF', 'SEA',
		'SFO', 'SGF', 'SGU', 'SHV', 'SIT', 'SJC', 'SJT', 'SJU', 'SLC', 'SMF',
		'SMX', 'SNA', 'SPI', 'SPN', 'SPS', 'SRQ', 'STL', 'STT', 'STX', 'SUN',
		'SWF', 'SYR', 'TLH', 'TPA', 'TRI', 'TTN', 'TUL', 'TUS', 'TVC', 'TWF',
		'TXK', 'TYR', 'TYS', 'UST', 'VLD', 'VPS', 'WRG', 'WYS', 'XNA', 'YAK', 
		'YUM'
	]
	choices = list(zip(airlines, airlines))
	airline = wtf.SelectField('Compagnie aérienne', choices=choices)
	choices = list(zip(airports, airports))
	dep_airport = wtf.SelectField('Aéroport de départ', choices=choices)
	dep_date = DateField("Date (locale) de départ du vol", 
							 validators=[DataRequired()], format='%Y-%m-%d',
							 default=datetime.datetime.today)	
	dep_time = TimeField("Heure (locale) de départ du vol", 
							 validators=[DataRequired()])								 
	flight_duration = TimeField('Durée annoncée du vol', 
								validators=[DataRequired()])
	#flight_departed = BooleanField('Avion déjà en vol')
	dep_delay = IntegerField('Retard au décollage, si connu (minutes)',
							 validators=[Optional(strip_whitespace=True)])
	submit = wtf.SubmitField("Prédire l'heure d'arrivée")
	
	def reset_choices(self):
		# Pourquoi ceci est-il nécessaire ?
		self.airline.choices = zip(self.airlines, self.airlines)
		self.dep_airport.choices = zip(self.airports, self.airports)
Beispiel #23
0
class EventForm(FlaskForm):
    name = StringField('Name *', validators=[DataRequired()])
    description = TextAreaField('Description')
    start_date = DateField('Start date *', validators=[DataRequired()])
    start_time = TimeField('Start time *', validators=[DataRequired()])
    end_date = DateField('End date *', validators=[DataRequired()])
    end_time = TimeField('End time *', validators=[DataRequired()])
    image = FileField('Profile Picture')
    submit = SubmitField()
Beispiel #24
0
class _TimePair(Form):
    start = TimeField(_(u'from'), [UsedIf(lambda form, field: form.end.data)])
    end = TimeField(_(u'to'), [UsedIf(lambda form, field: form.start.data)])

    def validate_start(self, field):
        if self.start.data and self.end.data and self.start.data >= self.end.data:
            raise ValidationError('The start time must be earlier than the end time.')

    validate_end = validate_start
Beispiel #25
0
class CreateForm(FlaskForm):
    sport = SelectField('Sport', choices=choices)
    starttime = TimeField('Start Time', [validators.InputRequired()])
    endtime = TimeField('End Time', [validators.InputRequired()])
    #starttime = datetime.strptime(str(starttime), '%H:%M')
    #endtime = datetime.strptime(str(endtime), '%H:%M')
    date = DateField('Date', validators=[DateRange(min=date.today())])  #y-m-d
    place = StringField('Place', [validators.InputRequired()])
    n_ppl = IntegerField('# of people needed', [validators.InputRequired()])
Beispiel #26
0
class EventForm(FlaskForm):
    name = StringField('Event name', validators=[DataRequired()])
    start_date = DateField('Event date', validators=[DataRequired(), DateRange(
        min=datetime.datetime.today().date())])
    start_time = TimeField('Event time', validators=[DataRequired()])
    end_date = DateField('Event end date', validators=[DataRequired(), DateRange(
        min=datetime.datetime.today().date())])
    end_time = TimeField('Event end time', validators=[DataRequired()])
    location = StringField('Event location', validators=[DataRequired()])
    submit = SubmitField('Propose Event')
Beispiel #27
0
class EditEventForm(FlaskForm):
    """
    Input forms used on the edit event page.
    """
    title = StringField('Title', validators=[DataRequired()])
    description = TextAreaField('Description', validators=[DataRequired()])
    date = DateField('Date', validators=[DataRequired(), DateRange(min=date.today())])
    startTime = TimeField('Start Time', validators=[DataRequired()])
    endTime = TimeField('End Time', validators=[DataRequired()])
    submit = SubmitField('Edit Event')
Beispiel #28
0
class AddTime(Form):
    weekday = StringField('Day of Week', [validators.Length(min=1, max=50)],
                          default='Monday')
    stime = TimeField(label='Start time',
                      validators=[validators.InputRequired()],
                      format="%H:%M")
    etime = TimeField(label='End time',
                      validators=[validators.InputRequired()],
                      format="%H:%M")
    bfield = BooleanField('Apply these times from Monday through Friday')
Beispiel #29
0
class CustomerForm(FlaskForm):
    name = StringField('Name of passenger', validators=[DataRequired()])
    from_destination = StringField('From', validators=[DataRequired()])
    to_destination = StringField('To', validators=[DataRequired()])
    leaving_date = DateField('departure date', validators=[DataRequired()])
    arrival_date = DateField('arrival date', validators=[DataRequired()])
    leaving_time = TimeField('leaving time', validators=[DataRequired()])
    arriving_time = TimeField('arriving time')
    phoneno = StringField('Phone number', validators=[DataRequired()])
    email = StringField('Email', validators=[Email()])
    pay = SubmitField('pay')
Beispiel #30
0
class ConfigForm(Form):
	alarm1_time = TimeField("Alarm 1 Time (full brightness)")
	alarm2_time = TimeField("Alarm 2 Time (full brightness)")

	rgb_normal = StringField("Normal RGB value")
	rgb_alarm = StringField("Alarm RGB value")

	default_brightness = IntegerField("Default brightness, %")
	alarm_brightness = IntegerField("Alarm brightness, %")

	submit = SubmitField("OK")