db like in tutorial

This commit is contained in:
Colin Goutte 2021-09-29 11:05:09 +02:00
parent b5710b3dfb
commit 6b4c8b69b8
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,14 @@ notifications = defaultdict(list)
Base.metadata.create_all(bind=engine)
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
class Notifier:
@staticmethod
def __call__(idsonde, changes):