Updated:
Hi all,
Going through the Werkzeug link text tutorial, got stack with creating SQLAlchemy session using sessionmaker() instead of create_session() as recommended.
Note: it is not about SA, it is about Werkzeug.
Werkzeug tutorial:
session = scoped_session(lambda: create_session(bind=application.database_engine,
autoflush=True, autocommit=False), local_manager.get_ident)
I asked how to achieve the same using sessionmaker():
As a result guys from #pocoo RCI helped me with this:
session = scoped_session(lambda: sessionmaker(bind=application.database_engine)(),
local_manager.get_ident)
without () at the end of sessionmaker(**args) it kept giving me an error:
RuntimeError: no object bound to application
P.S. if delete lambda it will not work.