-
Notifications
You must be signed in to change notification settings - Fork 0
/
populate_db.py
55 lines (45 loc) · 2.12 KB
/
populate_db.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
__author__ = 'Liam'
from application import db, PoolOwner, PoolShopAdmin, \
SPACSAdmin, Pool, Shop, Report
db.create_all()
owner = PoolOwner('PoolOwner1', 'a', 'Steve McQueen',
'73 Evergreen Terrace, Springfield',
owner1 = PoolOwner('PoolOwner2', 'b', 'Joe Bloggs',
'52 Sunset Drive, Springfield', '[email protected]')
shop_admin = PoolShopAdmin('PoolShopAdmin1', 'c', 'Ren Smith',
'44 Hobb Cover, Springfield',
shop_admin1 = PoolShopAdmin('PoolShopAdmin2', 'f', 'Smithy Ren',
'22 Cover Lane, Sprungfield',
spacs_admin = SPACSAdmin('SPACSAdmin1', 'd', 'Sally Fernando',
'3 Ord St, West City', '[email protected]')
shop = Shop('3', 'Ren\'s Pool Shack', '2a Floor Rd, San Hilderson',
'[email protected]', '+61 400 555 111')
shop1 = Shop('4', 'Smithy and Son Pool Supplies', '99 Surf Boulevard, Maxtown',
'[email protected]', '+61 400 555 112')
pool = Pool('6.2', '4.3', '3', 'Cement', 'In-ground', '1', '1')
pool1 = Pool('3', '2', '1.5', 'Plastic', 'Above-ground', '2', '1')
report = Report('This is an example report. Latest measurements are x,y,z. '
'Acid has been rising over the past month. Chlorine has been'
' dropping. Measurements are all still within nominal levels. '
'No recommendations available.', '2015-4-29')
report1 = Report('This is an earlier example report. Latest measurements are '
'x,y,z. Acid is stable. Chlorine is stable. Measurements '
'within nominal levels. No recommendations available.',
'2015-4-22')
report.pool_id = '1'
report1.pool_id = '1'
db.session.add(owner)
db.session.add(owner1)
db.session.add(shop_admin)
db.session.add(shop_admin1)
db.session.add(spacs_admin)
db.session.add(shop)
db.session.add(shop1)
db.session.add(pool)
db.session.add(pool1)
db.session.add(report)
db.session.add(report1)
db.session.commit()