forked from learn-co-curriculum/python-p3-freebie-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.py
More file actions
47 lines (36 loc) · 974 Bytes
/
debug.py
File metadata and controls
47 lines (36 loc) · 974 Bytes
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
#!/usr/bin/env python3
#!/usr/bin/env python3
# from sqlalchemy import create_engine
# from models import Company, Dev, Freebies
from freebie import Freebie
from company import Company
from dev import Dev
#! Drop all tables when first started to see if it works:
Company.drop_table()
Dev.drop_table()
Freebie.drop_table()
# #! Create all (3) tables to exist in the database:
Company.create_table()
Dev.create_table()
Freebie.create_table()
#! Create some dev instances
ollie = Dev("ollie")
ollie.save()
wally = Dev("Wally")
wally.save()
bill = Dev("Bill")
bill.save()
#! Create some company instances
docusign = Company("DocuSign", 1999)
docusign.save()
gitHub = Company("GitHub", 2002)
gitHub.save()
walmart = Company("Walmart", 1804)
walmart.save()
#! Create some Freebie instances
koozie = Freebie("Koozie", 10, gitHub.id, bill.id)
koozie.save()
hat = Freebie("Hat", 20, gitHub.id, wally.id)
hat.save()
pen = Freebie("Pen", 1, docusign.id, bill.id)
pen.save()