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 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(-) (limited to 'docs/quick_tutorial') 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 e6526f599bf4c98f9d7524f05203ee839b1b6c0a Mon Sep 17 00:00:00 2001 From: Behzod Saidov Date: Mon, 9 Dec 2019 14:29:57 -0800 Subject: Fixed typo. Remove extra $. --- docs/quick_tutorial/json.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/json.rst b/docs/quick_tutorial/json.rst index 44d1de8cb..19d346199 100644 --- a/docs/quick_tutorial/json.rst +++ b/docs/quick_tutorial/json.rst @@ -63,7 +63,7 @@ Steps .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/howdy.json in your browser and you will see the resulting JSON response. -- cgit v1.2.3 From 70abeebc3d1d075eb5846f670ddaf9e4eed9e61d Mon Sep 17 00:00:00 2001 From: Behzod Saidov Date: Mon, 9 Dec 2019 14:39:51 -0800 Subject: view_classes.rst doc: "classes" -> "functions" --- docs/quick_tutorial/view_classes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/view_classes.rst b/docs/quick_tutorial/view_classes.rst index 1307857b7..c9f61f5a3 100644 --- a/docs/quick_tutorial/view_classes.rst +++ b/docs/quick_tutorial/view_classes.rst @@ -78,7 +78,7 @@ To ease the transition to view classes, we didn't introduce any new functionality. We simply changed the view functions to methods on a view class, then updated the tests. -In our ``TutorialViews`` view class, you can see that our two view classes are +In our ``TutorialViews`` view class, you can see that our two view functions are logically grouped together as methods on a common class. Since the two views shared the same template, we could move that to a ``@view_defaults`` decorator at the class level. -- cgit v1.2.3