diff options
| -rw-r--r-- | CHANGES.txt | 11 | ||||
| -rw-r--r-- | docs/tutorials/wiki/definingviews.rst | 26 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/authorization/setup.py | 7 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/basiclayout/setup.py | 8 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/basiclayout/tutorial/tests.py | 3 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/basiclayout/tutorial/views.py | 2 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/models/setup.py | 7 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/models/tutorial/tests.py | 3 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/models/tutorial/views.py | 2 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/viewdecorators/setup.py | 7 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/views/setup.py | 7 |
11 files changed, 48 insertions, 35 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 7b0f550c9..e58c0bd25 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,17 @@ Bug Fixes - Tests now pass on Windows (no bugs found, but a few tests in the test suite assumed UNIX path segments in filenames). +Documentation +------------- + +- If you followed it to-the-letter, the ZODB+Traversal Wiki tutorial would + instruct you to run a test which would fail because the view callable + generated by the ``pyramid_zodb`` tutorial used a one-arg view callable, + but the test in the sample code used a two-arg call. + +- Updated ZODB+Traversal tutorial setup.py of all steps to match what's + generated by ``pyramid_zodb``. + 1.0a5 (2010-12-14) ================== diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index bbda3d45c..97314fb77 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -7,19 +7,19 @@ application is typically a simple Python function that accepts two parameters: :term:`context`, and :term:`request`. A view callable is assumed to return a :term:`response` object. -.. note:: A :app:`Pyramid` view can also be defined as callable - which accepts *one* arguments: a :term:`request`. You'll see this - one-argument pattern used in other :app:`Pyramid` tutorials and - applications. Either calling convention will work in any - :app:`Pyramid` application; the calling conventions can be used - interchangeably as necessary. In :term:`traversal` based - applications, such as this tutorial, the context is used frequently - within the body of a view method, so it makes sense to use the - two-argument syntax in this application. However, in :term:`url - dispatch` based applications, the context object is rarely used in - the view body itself, so within code that uses URL-dispatch-only, - it's common to define views as callables that accept only a request - to avoid the visual "noise". +.. note:: A :app:`Pyramid` view can also be defined as callable which accepts + *one* arguments: a :term:`request`. You'll see this one-argument pattern + used in other :app:`Pyramid` tutorials and applications. It was also used + in the ``my_view`` view callable that we deleted in the last chapter. + Either calling convention will work in any :app:`Pyramid` application; the + calling conventions can be used interchangeably as necessary. In + :term:`traversal` based applications, such as this tutorial, the context + is used frequently within the body of a view method, so it makes sense to + use the two-argument syntax in this application. However, in :term:`url + dispatch` based applications, the context object is rarely used in the + view body itself, so within code that uses URL-dispatch-only, it's common + to define views as callables that accept only a request to avoid the + visual "noise". We're going to define several :term:`view callable` functions then wire them into :app:`Pyramid` using some :term:`view diff --git a/docs/tutorials/wiki/src/authorization/setup.py b/docs/tutorials/wiki/src/authorization/setup.py index 7e4184312..c1b8e9f33 100644 --- a/docs/tutorials/wiki/src/authorization/setup.py +++ b/docs/tutorials/wiki/src/authorization/setup.py @@ -8,11 +8,11 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', - 'docutils', - 'ZODB3', 'repoze.zodbconn', 'repoze.tm', + 'ZODB3', 'WebError', + 'docutils', ] setup(name='tutorial', @@ -39,6 +39,7 @@ setup(name='tutorial', entry_points = """\ [paste.app_factory] main = tutorial:main - """ + """, + paster_plugins=['pyramid'], ) diff --git a/docs/tutorials/wiki/src/basiclayout/setup.py b/docs/tutorials/wiki/src/basiclayout/setup.py index 70543918c..a0de6ec81 100644 --- a/docs/tutorials/wiki/src/basiclayout/setup.py +++ b/docs/tutorials/wiki/src/basiclayout/setup.py @@ -8,10 +8,9 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', - 'docutils', - 'ZODB3', 'repoze.zodbconn', 'repoze.tm', + 'ZODB3', 'WebError', ] @@ -29,7 +28,7 @@ setup(name='tutorial', author='', author_email='', url='', - keywords='web pyramid bfg', + keywords='web pylons pyramid', packages=find_packages(), include_package_data=True, zip_safe=False, @@ -39,5 +38,6 @@ setup(name='tutorial', entry_points = """\ [paste.app_factory] main = tutorial:main - """ + """, + paster_plugins=['pyramid'], ) diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py b/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py index a43b917a8..26ee6671e 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py @@ -13,7 +13,6 @@ class ViewTests(unittest.TestCase): def test_my_view(self): from tutorial.views import my_view - context = testing.DummyModel() request = testing.DummyRequest() - info = my_view(context, request) + info = my_view(request) self.assertEqual(info['project'], 'tutorial') diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/views.py b/docs/tutorials/wiki/src/basiclayout/tutorial/views.py index 9a2c37bc3..93d619d83 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/views.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/views.py @@ -1,2 +1,2 @@ -def my_view(context, request): +def my_view(request): return {'project':'tutorial'} diff --git a/docs/tutorials/wiki/src/models/setup.py b/docs/tutorials/wiki/src/models/setup.py index 0ef8f137c..5034a3989 100644 --- a/docs/tutorials/wiki/src/models/setup.py +++ b/docs/tutorials/wiki/src/models/setup.py @@ -8,11 +8,11 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', - 'docutils', - 'ZODB3', 'repoze.zodbconn', 'repoze.tm', + 'ZODB3', 'WebError', + 'docutils', ] setup(name='tutorial', @@ -39,5 +39,6 @@ setup(name='tutorial', entry_points = """\ [paste.app_factory] main = tutorial:main - """ + """, + paster_plugins=['pyramid'], ) diff --git a/docs/tutorials/wiki/src/models/tutorial/tests.py b/docs/tutorials/wiki/src/models/tutorial/tests.py index 25cb04cc6..839964538 100644 --- a/docs/tutorials/wiki/src/models/tutorial/tests.py +++ b/docs/tutorials/wiki/src/models/tutorial/tests.py @@ -58,7 +58,6 @@ class ViewTests(unittest.TestCase): def test_my_view(self): from tutorial.views import my_view - context = testing.DummyModel() request = testing.DummyRequest() - info = my_view(context, request) + info = my_view(request) self.assertEqual(info['project'], 'tutorial') diff --git a/docs/tutorials/wiki/src/models/tutorial/views.py b/docs/tutorials/wiki/src/models/tutorial/views.py index 9a2c37bc3..93d619d83 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views.py +++ b/docs/tutorials/wiki/src/models/tutorial/views.py @@ -1,2 +1,2 @@ -def my_view(context, request): +def my_view(request): return {'project':'tutorial'} diff --git a/docs/tutorials/wiki/src/viewdecorators/setup.py b/docs/tutorials/wiki/src/viewdecorators/setup.py index 0ef8f137c..5ee1333bc 100644 --- a/docs/tutorials/wiki/src/viewdecorators/setup.py +++ b/docs/tutorials/wiki/src/viewdecorators/setup.py @@ -8,11 +8,11 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', - 'docutils', - 'ZODB3', 'repoze.zodbconn', 'repoze.tm', + 'ZODB3', 'WebError', + 'docutils', ] setup(name='tutorial', @@ -39,5 +39,6 @@ setup(name='tutorial', entry_points = """\ [paste.app_factory] main = tutorial:main - """ + """, + paster_plugins = ['pyramid'], ) diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index 0ef8f137c..5034a3989 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -8,11 +8,11 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', - 'docutils', - 'ZODB3', 'repoze.zodbconn', 'repoze.tm', + 'ZODB3', 'WebError', + 'docutils', ] setup(name='tutorial', @@ -39,5 +39,6 @@ setup(name='tutorial', entry_points = """\ [paste.app_factory] main = tutorial:main - """ + """, + paster_plugins=['pyramid'], ) |
