-
Notifications
You must be signed in to change notification settings - Fork 4
/
forms.py
29 lines (21 loc) · 1.02 KB
/
forms.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
from flask_mongoengine.wtf import model_form
from flask_mongoengine.wtf.orm import validators
from flask_wtf import FlaskForm
from wtforms import BooleanField
from wtforms import PasswordField
from wtforms import RadioField
from wtforms import StringField
import models
user_form = model_form(models.User, exclude=['password'])
class SignupForm(user_form):
password = PasswordField('Password', validators=[validators.DataRequired(),
validators.EqualTo('confirm', message='Passwords must match')])
confirm = PasswordField('Repeat Password')
class LoginForm(user_form):
password = PasswordField('Password', validators=[validators.DataRequired()])
remember = BooleanField("Remember Me")
class OperationForm(FlaskForm):
security = StringField("security")
shares = StringField("shares")
operation = RadioField("operation", choices=[('value', 'buy'), ('value', 'sell')])
methods = RadioField("methods", choices=[('value', 'twap'), ('value_two', 'vwap')])