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
24 lines (18 loc) · 606 Bytes
/
debug.py
File metadata and controls
24 lines (18 loc) · 606 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
# debug.py
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Base, Dev, Company, Freebie
import ipdb
# Set up database and session
engine = create_engine('sqlite:///freebies.db')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
session = Session()
print(" Companies:", session.query(Company).all())
print(" Devs:", session.query(Dev).all())
print("Freebies:", session.query(Freebie).all())
# Open IPython Debugger
ipdb.set_trace()