-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
34 lines (27 loc) · 1.32 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from wtforms import Form, IntegerField, SelectField, validators
from math import pi
from CurrencyConv import getWorldCurrencies, getFinalWorldCurrencies
class InputForm(Form):
style = {"style": "text-align:center"}
decimalPlaces = SelectField(
label='Select Decimal Approximation:', default=1,
validators=[validators.InputRequired()],
choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], render_kw=style
)
speed = SelectField(label="Select Approximation Speed:", validators=[validators.InputRequired()],
choices=[('Slow', 'Slow'), ('Fast', 'Fast')],
)
class CurrForm(Form):
style = {"style": "text-align:center"}
baseCurr = SelectField(
label='Select Base Currency:', default='USD', validators=[validators.InputRequired()],
choices=getFinalWorldCurrencies(), render_kw=style
)
baseCurrAmount = IntegerField(
label='Enter Base Amount:', default='1', validators=[validators.NumberRange(min=1), validators.InputRequired()],
render_kw=style
)
targetCurr = SelectField(
label='Select Target Currency:', default='USD', validators=[validators.InputRequired()],
choices=getFinalWorldCurrencies(), render_kw=style
)