From 9ffdc7c9270ca9ef25ed01495e5f210db9d37710 Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 14:18:35 +0100 Subject: ZopeTransactionExtension is not valid anymore, replace with zope.sqlalchemy.register The new version of zope.sqlalchemy does not provide ZopeTransactionExtension anymore. As stated in (this official PR)[https://github.com/zopefoundation/zope.sqlalchemy/pull/38] --- docs/quick_tutorial/databases/tutorial/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/databases/tutorial/models.py b/docs/quick_tutorial/databases/tutorial/models.py index b27c38417..2d70e0db6 100644 --- a/docs/quick_tutorial/databases/tutorial/models.py +++ b/docs/quick_tutorial/databases/tutorial/models.py @@ -13,10 +13,10 @@ from sqlalchemy.orm import ( sessionmaker, ) -from zope.sqlalchemy import ZopeTransactionExtension +from zope.sqlalchemy import register -DBSession = scoped_session( - sessionmaker(extension=ZopeTransactionExtension())) +DBSession = scoped_session(sessionmaker(autoflush=False)) +register(DBSession) Base = declarative_base() @@ -32,4 +32,4 @@ class Root(object): (Allow, 'group:editors', 'edit')] def __init__(self, request): - pass \ No newline at end of file + pass -- cgit v1.2.3