summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndrea Borghi <danduk82@users.noreply.github.com>2019-11-11 14:18:35 +0100
committerAndrea Borghi <andrea.borghi@swisstopo.ch>2019-11-11 16:01:33 +0100
commit9ffdc7c9270ca9ef25ed01495e5f210db9d37710 (patch)
tree68f44d8a5e41b8b0724ba933c2e783b11d2d8645 /docs
parente6596143be10ee629f97f1c95b02073f76f65986 (diff)
downloadpyramid-9ffdc7c9270ca9ef25ed01495e5f210db9d37710.tar.gz
pyramid-9ffdc7c9270ca9ef25ed01495e5f210db9d37710.tar.bz2
pyramid-9ffdc7c9270ca9ef25ed01495e5f210db9d37710.zip
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]
Diffstat (limited to 'docs')
-rw-r--r--docs/quick_tutorial/databases/tutorial/models.py8
1 files 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