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
29 lines (24 loc) · 828 Bytes
/
Copy pathdebug.py
File metadata and controls
29 lines (24 loc) · 828 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
#!/usr/bin/env python3
from sqlalchemy import create_engine
from models import session,Company, Dev,Freebie
if __name__ == '__main__':
engine = create_engine('sqlite:///freebies.db')
#import ipdb; ipdb.set_trace()
# Test Dev
njeri = session.query(Dev).filter_by(name="Njeri").first()
if njeri:
print(njeri.companies)
else:
print("Developer Njeri not found.")
# Test Company
techSolutions = session.query(Company).filter_by(name="TechSolutions").first()
if techSolutions:
print(techSolutions.devs)
else:
print("Company TechSolutions not found.")
# Test Freebie
freebie = session.query(Freebie).filter_by(item_name="T-Shirt").first()
if freebie:
print(freebie.print_details())
else:
print("Freebie T-Shirt not found.")