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(-) 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 From 418e64eb644f7a850ec87002ec8c875eb8b1b843 Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 14:55:32 +0100 Subject: remove autoflush=False autoflush is necessary for the current implementation views.py --- docs/quick_tutorial/databases/tutorial/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick_tutorial/databases/tutorial/models.py b/docs/quick_tutorial/databases/tutorial/models.py index 2d70e0db6..8e6649d49 100644 --- a/docs/quick_tutorial/databases/tutorial/models.py +++ b/docs/quick_tutorial/databases/tutorial/models.py @@ -15,7 +15,7 @@ from sqlalchemy.orm import ( from zope.sqlalchemy import register -DBSession = scoped_session(sessionmaker(autoflush=False)) +DBSession = scoped_session(sessionmaker()) register(DBSession) Base = declarative_base() -- cgit v1.2.3 From 85a98147d4098593b7ff6781a140ddea6a0b523f Mon Sep 17 00:00:00 2001 From: Andrea Borghi Date: Mon, 11 Nov 2019 15:56:07 +0100 Subject: sign CONTRIBUORS.txt chart --- CONTRIBUTORS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f41e5fdb5..65be5e259 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -348,3 +348,5 @@ Contributors - Jonathan Vanasco, 2019/11/05 - Jan Likar, 2019/11/07 + +- Andrea Borghi, 2019/11/11 -- cgit v1.2.3