You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@contextmanager
def session_scope():
"""Provide a transactional scope around a series of operations."""
session = SessionLocal()
try:
yield session
session.commit()
except:
session.rollback()
raise
finally:
session.close()
with session_scope() as session:
BaseModel.set_session(session)
session = scoped_session(sessionmaker(bind=engine, autocommit=True))
The text was updated successfully, but these errors were encountered: