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
28 lines (19 loc) · 723 Bytes
/
Copy pathdebug.py
File metadata and controls
28 lines (19 loc) · 723 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
#!/usr/bin/env python3
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Base, Company, Dev, Freebie
if __name__ == '__main__':
engine = create_engine('sqlite:///freebies.db')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
session = Session()
c1 = Company(name="Kenya Power", founding_year=2015)
d1 = Dev(name="Marvin")
d2 = Dev(name="Eric")
session.add_all([c1, d1, d2])
session.commit()
f1 = Freebie(item_name="Tote Bag", value=10, company=c1, dev=d1)
f2 = Freebie(item_name="Iphone", value=250, company=c1, dev=d2)
session.add_all([f1, f2])
session.commit()
import ipdb; ipdb.set_trace()