forked from Gaurav-Shah05/IITGN-Guesthouse-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
112 lines (94 loc) · 6.05 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, DateField, BooleanField, TextAreaField, PasswordField, SelectField, SubmitField, TimeField
from wtforms.validators import DataRequired, Email, Length, ValidationError
class BookingForm(FlaskForm):
number_of_people = SelectField('Number of People',choices=[(1,1),(2,2)], validators=[DataRequired()])
check_in_date = DateField('Check-in Date', validators=[DataRequired()])
check_out_date = DateField('Check-out Date', validators=[DataRequired()])
room_type = SelectField('Room Type', choices=[('double bed', 'double bed'), ('twin bed', 'twin bed'), ('suite', 'suite')], validators=[DataRequired()])
specially_enabled_room_required = BooleanField('Specially Enabled Room Required')
comments = TextAreaField('Comments')
email_id = StringField('Email ID', validators=[DataRequired(), Email()])
iitgn_id = IntegerField('IITGN ID', validators=[DataRequired()])
submit = SubmitField('Submit')
class BookingFormMember(FlaskForm):
number_of_people = SelectField('Number of People',choices=[(1,1),(2,2)], validators=[DataRequired()])
check_in_date = DateField('Check-in Date', validators=[DataRequired()])
check_out_date = DateField('Check-out Date', validators=[DataRequired()])
room_type = SelectField('Room Type', choices=[('double bed', 'double bed'), ('twin bed', 'twin bed'), ('suite', 'suite')], validators=[DataRequired()])
specially_enabled_room_required = BooleanField('Specially Enabled Room Required')
comments = TextAreaField('Comments')
email_id = StringField('Email ID', validators=[DataRequired(), Email()])
iitgn_id = IntegerField('IITGN ID', validators=[DataRequired()])
submit = SubmitField('Submit')
class CheckInForm(FlaskForm):
first_name = StringField('First Name', validators=[DataRequired()])
last_name = StringField('Last Name', validators=[DataRequired()])
age = IntegerField('Age', validators=[DataRequired()])
street = StringField('Street', validators=[DataRequired()])
state = StringField('State', validators=[DataRequired()])
pincode = IntegerField('Pincode', validators=[DataRequired()])
country = StringField('Country', validators=[DataRequired()])
phone_no = StringField('Phone Number', validators=[DataRequired()])
guest_category = SelectField('Guest Category', choices=[('student', 'Student'), ('faculty', 'Faculty'), ('other', 'Other')], validators=[DataRequired()])
visit_purpose = TextAreaField('Visit Purpose', validators=[DataRequired()])
email_id = StringField('Email ID', validators=[DataRequired(), Email()])
submit = SubmitField('Submit')
class CheckOutForm(FlaskForm):
guest_id = IntegerField('Guest ID', validators=[DataRequired()])
submit = SubmitField('Submit')
class MaintenanceRequestForm(FlaskForm):
description = TextAreaField('Description', validators=[DataRequired()])
submit = SubmitField('Submit')
class TravelRequestForm(FlaskForm):
number_of_travellers = IntegerField('Number of Travellers', validators=[DataRequired()])
date_of_travel = DateField('Date of Travel', validators=[DataRequired()])
pick_up_time = TimeField('Pick-up Time', validators=[DataRequired()])
destination = StringField('Destination', validators=[DataRequired()])
travel_purpose = TextAreaField('Travel Purpose', validators=[DataRequired()])
submit = SubmitField('Submit')
class LoginForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(), Email()])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Submit')
class RegistrationForm(FlaskForm):
first_name = StringField('First Name', validators=[DataRequired()])
last_name = StringField('Last Name', validators=[DataRequired()])
email = StringField('Email', validators=[DataRequired(), Email()])
password = PasswordField('Password', validators=[DataRequired(), Length(min=6)])
confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), Length(min=6)])
submit = SubmitField('Register')
def validate_confirm_password(self, field):
if field.data != self.password.data:
raise ValidationError('Passwords do not match')
class enter_guest_idForm(FlaskForm):
guest_id = IntegerField('Guest ID', validators=[DataRequired()])
submit = SubmitField('Submit')
class billForm(FlaskForm):
guest_id = IntegerField('Guest ID', validators=[DataRequired()])
amount = IntegerField('Amount', validators=[DataRequired()])
bill_type = StringField('Bill Type', validators=[DataRequired()])
payment_method = StringField('Payment Method', validators=[])
paid_status = SelectField('Paid Status', choices=[(1,'paid'), (0, 'unpaid')], validators=[DataRequired()])
generated_by = StringField('Generated By', validators=[DataRequired()])
description = TextAreaField('Description', validators=[DataRequired()])
submit = SubmitField('Submit')
class ChangePasswordFirst(FlaskForm):
new_password = PasswordField('New Password', validators=[DataRequired(), Length(min=6)])
confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), Length(min=6)])
submit = SubmitField('Submit')
def validate_confirm_password(self, field):
if field.data != self.new_password.data:
raise ValidationError('Passwords do not match')
class ChangePassword(FlaskForm):
old_password = PasswordField('Old Password', validators=[DataRequired()])
new_password = PasswordField('New Password', validators=[DataRequired(), Length(min=6)])
confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), Length(min=6)])
submit = SubmitField('Submit')
def validate_confirm_password(self, field):
if field.data != self.new_password.data:
raise ValidationError('Passwords do not match')
class FeedbackForm(FlaskForm):
feedback = TextAreaField('Feedback', validators=[DataRequired()])
star_rating = SelectField('Star Rating', choices=[(5,5),(4,4),(3,3),(2,2),(1,1)], validators=[DataRequired()])
submit = SubmitField('Submit')