-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRun.py
88 lines (75 loc) · 7.11 KB
/
Run.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
from myshop import app, db
from myshop.classes import Products, Adverts, User
from flask_bootstrap import Bootstrap
from flask import url_for
#PRODUCT CAT CODES
# OVUS - OVERSUIT/UNDERSUIT
# PRO - PROTECTION
# ACC - ACCESSORIES
# SRT - SRT EQUIPMENT
desc = ["The suit is made from durable, waterproof material that can withstand the harsh and wet conditions found in caves, and is designed to protect the wearer from abrasions, cuts, and scrapes. (References: Generated by ChatGPT)",
"The suit is made from durable, waterproof material that can withstand the harsh and wet conditions found in caves, and is designed to protect the wearer from abrasions, cuts, and scrapes. (References: Generated by ChatGPT)",
"The perfect base layer for any serious caver or cave explorer. Made from high-performance materials, this undersuit is designed to provide an additional layer of insulation and moisture-wicking properties, which can help keep you warm and dry while exploring caves. (References: Generated by ChatGPT)",
"ultra-durable helmet, featuring added coverage on both the sides and back, while maintaining a sleek,cradle fit for all-day comfort. (References: Summits Outdoors. Black Diamond Capitan Climbing Helmet. Available at: https://www.summits.co.uk/product/black-diamond-capitan-climbing-helmet-s-m-patina-black/)",
"Lightweight aluminum carabiner with a symmetrical oval shape that allows optimal loading of devices with a wide cross-section. (References: Petzl. OK. Available at: https://www.petzl.com/GB/en/Sport/Carabiners-And-Quickdraws/OK)",
"Lightweight aluminum croll allowing the user to ascend caves with ease.",
"Ascend with ease with a brand new cowstails suited to your height.",
"Keep all your belongings dry whilst caving with a Daren Drum. Designed to last, even when dropped.",
"Keep all your belongings dry whilst caving with a Daren Drum. Designed to last, even when dropped.",
"ultra-durable helmet, featuring added coverage on both the sides and back, while maintaining a sleek,cradle fit for all-day comfort. (References: Summits Outdoors. Black Diamond Capitan Climbing Helmet. Available at: https://www.summits.co.uk/product/black-diamond-capitan-climbing-helmet-s-m-patina-black/)",
"Lightweight and comfortable climbing harness for performance while climbing.",
"Keep all your belongings together whilst caving with the Adventure Verticle tackle sack.",
"Warmbac oversuits are known by cavers around the world as a quality product. Trusted by experienced cavers and outdoor centres alike they are as tough as they come. (References: Warmbac. Caving Oversuits. Available at: https://warmbac.com/listing_oversuits.php)",
"is crawling doing in your knees? Enhance your caving experience today with Warmbac kneepads, so you can finally cave without injuring your knees!",
"Fenix HM65R is a powerful dual beam outdoor headlamp which utilizes a magnesium alloy body for light weight and excellent heat dissipation. (References: MyFenix. Fenix HM65R Headlamp. Available at: https://www.myfenix.co.uk/product/fenix-hm65r-headlamp-1722)"]
descLists = ["More freedom for wearer,Tough Condura 600 material,1 year warrenty",
"More freedom for wearer,Tough Condura 600 material,1 year warrenty",
"Breathable,1 year warrenty,suitable for colder caves",
"Removable velcro pads,300kg impact rated,3 year warrenty",
"Made of aircraft-grade steel,3 year warrenty,long-lasting screw gate",
"Made of robust aluminium,New strengthened teeth,3 year warrenty",
"Custom sizes,10mm dia rope,Carabenas not included",
"4L capacity,Made of strengthened HDPE Plastic,Waterproof",
"6L capacity,Made of strengthened HDPE Plastic,Waterproof",
"Removable velcro pads,300kg impact rated,3 year warrenty",
"Suitable for M/L,High-strength polyester webbing,steel buckles",
"Abrasive resistant PVC,Can fit a 4L Daren Drum,Suitable for larger trips",
"Make in the UK,Tough Condura 600 material,3 year warrenty",
"Front made from kevlar material,Elastic straps,3 year warrenty",
"3200 lumen output,8h battery life,3 year warrenty"]
# Adding items to the db on run
def setProductsStart():
Products.setItemID("Adventure Verticle Mens Oversuit",120,desc[0],descLists[0],url_for('static', filename='media/AV-MAN.png'), True, "OVUS", 120)
Products.setItemID("Adventure Verticle Womens Oversuit",120,desc[1],descLists[1],url_for('static', filename='media/AV-WMN.png'), False, "OVUS",120)
Products.setItemID("Adventure Verticle Undersuit",100,desc[2],descLists[2],url_for('static', filename='media/Undersuit.png'), False, "OVUS",80)
Products.setItemID("Black Diamond Helmet",56,desc[3],descLists[3],url_for('static', filename='media/BD-HELM.png'), False, "PRO",200)
Products.setItemID("Petzl Locking Carabena",11,desc[4],descLists[4],url_for('static', filename='media/CARA.png'), True, "SRT",47)
Products.setItemID("Petzl Chest Croll",49,desc[5],descLists[5],url_for('static', filename='media/CHEST-CROLL.png'), False, "SRT",57)
Products.setItemID("Cowstails",5.50,desc[6],descLists[6],url_for('static', filename='media/COWT.png'), False, "SRT", 12)
Products.setItemID("Daren Drum Small",5,desc[7],descLists[7],url_for('static', filename='media/DD-SMALL.png'), False, "ACC", 136)
Products.setItemID("Daren Drum Large",7.75,desc[8],descLists[8],url_for('static', filename='media/dd.png'), False, "ACC", 174)
Products.setItemID("Petzl Helmet",49,desc[9],descLists[9],url_for('static', filename='media/PETZL-HLM.png'), True, "PRO", 232)
Products.setItemID("Petzl Harness",72,desc[10],descLists[10],url_for('static', filename='media/PETZL-HRNS.png'), False, "SRT", 147)
Products.setItemID("Adventure Verticle Tackle sack",44,desc[11],descLists[11],url_for('static', filename='media/TACKLEB.png'), False, "ACC", 325)
Products.setItemID("Warmbac Oversuit",78,desc[12],descLists[12],url_for('static', filename='media/WB1.png'), False, "OVUS", 113)
Products.setItemID("Warmbac Kneepads",42,desc[13],descLists[13],url_for('static', filename='media/KP.png'), False, "PRO", 54)
Products.setItemID("Fenix HM65R Headlamp",86,desc[14],descLists[14],url_for('static', filename='media/hl.png'), False, "ACC", 310)
# Adding adverts to the db on run
def setAdverts():
Adverts.setAdverts(1, url_for('static', filename='media/ADVERT1.gif'))
Adverts.setAdverts(2, url_for('static', filename='media/ADVERT2.png'))
Adverts.setAdverts(3, url_for('static', filename='media/ADVERT3.jpg'))
Adverts.setAdverts(4, url_for('static', filename='media/ADVERT4.webp'))
# Adding users to the db on run
def setUsers():
User.registerUser("Dylan Wase", "[email protected]", "123")
User.registerUser("Bob", "[email protected]", "123")
User.registerUser("Aaron", "[email protected]", "123")
if __name__ == '__main__':
with app.app_context(), app.test_request_context():
db.create_all()
if Products.query.first() is None:
setProductsStart()
setAdverts()
setUsers()
app.run(debug=True)