-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
44 lines (36 loc) · 2.77 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField ,IntegerField,SelectField
from wtforms.validators import DataRequired, Length, email, EqualTo
class RegistrationForm(FlaskForm):
username = StringField('Username',
validators=[DataRequired(), Length(min=2, max=20)])
email = StringField('Email',
validators=[DataRequired(), email()])
age=IntegerField('Age',
validators=[DataRequired()])
gender=SelectField('Gender', choices = [('Select one option','Select one option'),('Male', 'Male'),('Female', 'Female'),('Other','Other')])
region= SelectField('Region', choices = [('Select one option','Select one option'),('Rural', 'Rural'),('Urban', 'Urban')])
city=StringField('City',
validators=[DataRequired()])
state=SelectField('State',choices = [('Choose the State','Choose the State'),('Andhra Pradesh','Andhra Pradesh'),('Arunachal Pradesh','Arunachal Pradesh'),('Assam','Assam'),('Bihar','Bihar'),('Chhattisgarh','Chhattisgarh'),('Goa','Goa'),('Gujarat','Gujarat'),('Haryana','Haryana'),('Himachal','Himachal'),('Jammu and Kashmir','Jammu and Kashmir'),('Jharkhand','Jharkhand'),('Karnataka','Karnataka'),('Kerale','Kerala'),('Madhya Pradesh','Madhya Pradesh'),('Maharashtra','Maharashtra'),('Manipur','Manipur'),('Meghalaya','Meghalaya'),('Mizoram','Mizoram'),('Nagaland','Nagaland'),('Odisha','Odisha'),('Punjab','Punjab'),('Rajasthan','Rajasthan'),('Sikkim','Sikkim'),('Tamil Nadu','Tamil Nadu'),('Telangana','Telangana'),('Tripura','Tripura'),('Uttar Pradesh','Uttar Pradesh'),('Uttarakhand','Uttarakhand'),('West Bengal','West Bengal')])
password = PasswordField('Password', validators=[DataRequired()])
confirm_password = PasswordField('Confirm Password',
validators=[DataRequired(), EqualTo('password')])
submit = SubmitField('Sign Up')
class LoginForm(FlaskForm):
email = StringField('Email',
validators=[DataRequired(), email()])
password = PasswordField('Password', validators=[DataRequired()])
remember = BooleanField('Remember Me')
submit = SubmitField('Login')
class ResetRequestForm(FlaskForm):
email = StringField('Email',
validators=[DataRequired(), email()])
submit = SubmitField('Reset Pssword')
class ResetPassword(FlaskForm):
otp= StringField('OTP',
validators=[DataRequired(), Length(min=2, max=20)])
password = PasswordField('Password', validators=[DataRequired()])
confirm_password = PasswordField('Confirm Password',
validators=[DataRequired(), EqualTo('password')])
submit = SubmitField('Reset Password')