-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
78 lines (58 loc) · 2.76 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
from wtforms import Form, StringField, TextAreaField, PasswordField, validators,SelectField, IntegerField, BooleanField
from wtforms.fields.html5 import DateField
from passlib.hash import sha256_crypt
# forms used
class AddNewProd(Form):
p_name = StringField('Product Name', [validators.Length(min=2, max=30)])
added = IntegerField('Intital Quantity', [validators.NumberRange(min=1, max=1000)])
cost = IntegerField('selling Cost per unit')
cost_p = IntegerField('Manufacturing Cost per unit')
class EditCost(Form):
cost = IntegerField('Selling Cost per unit')
cost_p = IntegerField('Manufacturing Cost per unit')
class EditQuantity(Form):
quantity = IntegerField('Original quantity')
no_products = IntegerField("Add new quantity")
class AddEmp(Form):
u_name = StringField('Username', [validators.Length(min=4, max=30)])
u_pass = PasswordField('Password', [validators.DataRequired()])
u_type = SelectField('Access Type', choices=['Admin', 'Non-Admin'])
# u_type is admin_status in database
# admin_status as 1 is user is admin
# admin_status as 0 is user is non admin/employee
class AddToCart(Form):
# cus_name = StringField('Customer Name')
p_name = SelectField('Product', choices=[])
added = IntegerField('Quantity', [validators.NumberRange(min=1, max=100)])
class CusName(Form):
cusname = StringField('Customer Name', [validators.Length(min=1, max=30)])
cusphone = StringField("Customer Phone",[validators.Length(10)])
b_date = DateField("Date",format="%Y-%m-%d")
class RecordGenration(Form):
rec_type = SelectField("Type",choices = ['Date_Interval','Date_to_Days','All_Month'])
rec_type1 = SelectField("Product", choices = ['All','Product'])
class DateInterval(Form):
date1 = DateField("Start Date",format="%Y-%m-%d")
date2 = DateField("End Date",format="%Y-%m-%d")
class DayInterval(Form):
date = DateField("Start Date",format="%Y-%m-%d")
days = IntegerField("Days",[validators.NumberRange(min=1, max=30)])
class DateIntervalP(Form):
date1 = DateField("Start Date",format="%Y-%m-%d")
date2 = DateField("End Date",format="%Y-%m-%d")
prod = SelectField("Product", choices=[])
class DayIntervalP(Form):
date = DateField("Start Date",format="%Y-%m-%d")
days = IntegerField("Days",[validators.NumberRange(min=1, max=30)])
prod = SelectField("Product", choices=[])
class Month(Form):
year = IntegerField("Year",[validators.NumberRange(min=2010, max=2020)])
class MonthP(Form):
year = IntegerField("Year",[validators.NumberRange(min=2010, max=2020)])
prod = SelectField("Product", choices=[])
class PassChange(Form):
prev = PasswordField('Previous Password', [validators.DataRequired()])
new = PasswordField('New Password', [validators.DataRequired()])
class SearchBill(Form):
c_name=SelectField("Name",choices=[])
c_contact=SelectField("Contact no",choices=[])