Esempio n. 1
0
class GroupForm(FlaskForm):
    '''group signup'''

    group_name = StringField('group name', validators=[
        DataRequired(),
    ])
    group_target = IntegerField(widget=NumberInput(),
                                validators=[DataRequired()])
    member_limit = IntegerField(widget=NumberInput(),
                                validators=[DataRequired()])
    submit_button = SubmitField('Create')
Esempio n. 2
0
class FilterForm(FlaskForm):
    area_min = IntegerField("Площадь от", widget=NumberInput())
    area_max = IntegerField("Площадь до", widget=NumberInput())
    floor = IntegerField("Этаж", widget=NumberInput())
    subway_station_id = SelectField("Метро",
                                    coerce=int,
                                    choices=[(0, "- Не выбрано")],
                                    default=0)
    submit = SubmitField("Применить")
    clear = SubmitField("Сбросить")

    arg_keys = ['area_min', 'area_max', 'floor', 'subway_station_id']
Esempio n. 3
0
class UploadZodiForm(FlaskForm):
    psfs_choice = SelectField('Choose PSF Types',
                              choices=[('os5','OS5'), ('cgi','CGI')])
    users_zodi_file = FileField('Upload Your Zodiacal Model:',
                                validators = [FileRequired()])
    cmr = FloatField('Enter the core-mask radius value in milliarcseconds:',
                     widget = NumberInput(min=0,max=200),
                     default = 0,
                     validators = [DataRequired()])
    thresh = FloatField('Enter the threshold value:',
                        widget = NumberInput(min=1),
                        default = None,
                        validators = [Optional()])
    submit = SubmitField('Upload and Process')
class NameForm(Form):
    name = StringField(u'Story Title', validators=[DataRequired()])
    story = TextAreaField(u'User Story', validators=[DataRequired()])
    criteria = TextAreaField(u'Acceptance Criteria',
                             validators=[DataRequired()])
    business = IntegerField(
        u'Business Value', widget=NumberInput(step=100)
    )  # widget=NumberInput(u'Business Value', [validators.NumberRange(min=100, max=1500)]), )
    estimation = IntegerField(u'Estimation', widget=NumberInput(step=0.5))
    status = SelectField(u'Status',
                         choices=[('planning', 'Planning'), ('to_do', 'To Do'),
                                  ('in_progress', 'In Progress'),
                                  ('review', 'Review'), ('done', 'Done')])
    submit = SubmitField('Submit')
    IntegerField(widget=NumberInput())
Esempio n. 5
0
class NewProductForm(FlaskForm):
    productOwner = SelectField('Username of owner:',
                               validators=[DataRequired()])

    productName = StringField('Product name:', validators=[DataRequired()])

    imageFile = FileField("Image", validators=[file_required()])

    productPrice = DecimalField("Product price:",
                                widget=NumberInput(0.01, 0.01),
                                validators=[DataRequired()])

    create = SubmitField('Create Product')
Esempio n. 6
0
class TradeForm(FlaskForm):
    stocks = SelectField("Select stock", [
            validators.DataRequired()],
            render_kw={"class": "form-control form-control-sm"})
    amount = IntegerField("Amount", [
            validators.NumberRange(min=1)],
            widget=NumberInput(),
            render_kw={"placeholder": "0"})
    date = DateField("DateTime",
            format="%Y-%m-%d",
            render_kw={"size": "2"})
    #get time from datefield
    #(form.)date.data.strftime("%Y-%m-%d")
    price = DecimalFieldWithDotAndCommas("Price", [
            validators.NumberRange(min=0)],
            render_kw={"placeholder": "1.234"})
    submit = SubmitField("Open new position")

    def __init__(self, *args, **kwargs):
        super(TradeForm, self).__init__(*args, **kwargs)
        self.stocks.choices = Stock.find_all_stocks_alphabetically()
    
    class Meta:
        csrf = False
Esempio n. 7
0
class UpdateAlertsForm(FlaskForm):
    allow_alerts = BooleanField()
    days_before_alert = IntegerField(validators=[DataRequired()],
                                     widget=NumberInput())
    submit = SubmitField('Update Alerts')
Esempio n. 8
0
class ChangeAdminForm(FlaskForm):
    members_id = IntegerField(widget=NumberInput(),
                              validators=[DataRequired()])
    change = SubmitField('Change')
Esempio n. 9
0
class TournamentForm(FlaskForm):
    name = StringField("Name", [validators.DataRequired(message='Must not be a string containing only whitespace'), validators.Length(min=4, max=144)]) 
    playercount = IntegerField("Playercount", [validators.AnyOf(values=[2,4,8,16,32,64,128])], widget=NumberInput())
    description = TextAreaField("Tournament description", [validators.Length(max=500)])

    class Meta:
        csrf = False
Esempio n. 10
0
class ContractForm(FlaskForm):
    days_to_rent = IntegerField('Days to lease', validators=[DataRequired()], \
        widget=NumberInput(min=1, max=20))
    user = HiddenField()

    submit = SubmitField('Lease')