From a8f6693def4f60f673806c79c1092c8d58a8e10d Mon Sep 17 00:00:00 2001 From: Adam Groszer Date: Thu, 12 Sep 2013 17:27:52 +0200 Subject: Add doc about the top level member limitation of ``view_config`` --- pyramid/view.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pyramid/view.py b/pyramid/view.py index edb4d688c..55ab38871 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -166,6 +166,9 @@ class view_config(object): See :ref:`mapping_views_using_a_decorator_section` for details about using :class:`pyramid.view.view_config`. + ATTENTION: ``view_config`` will work ONLY on module top level members + because of the limitation of ``venusian.Scanner.scan``. + """ venusian = venusian # for testing injection def __init__(self, **settings): @@ -205,7 +208,7 @@ class view_defaults(view_config): See :ref:`view_defaults` for more information. """ - + def __call__(self, wrapped): wrapped.__view_defaults__ = self.__dict__.copy() return wrapped @@ -305,7 +308,7 @@ class notfound_view_config(object): from pyramid.view import notfound_view_config from pyramid.response import Response - + @notfound_view_config() def notfound(request): return Response('Not found, dude!', status='404 Not Found') @@ -368,7 +371,7 @@ class forbidden_view_config(object): from pyramid.view import forbidden_view_config from pyramid.response import Response - + @forbidden_view_config() def forbidden(request): return Response('You are not allowed', status='401 Unauthorized') @@ -404,4 +407,4 @@ class forbidden_view_config(object): settings['_info'] = info.codeinfo # fbo "action_method" return wrapped - + -- cgit v1.2.3 From 93137f090f24b1ffa4812b282adf95708576c1a1 Mon Sep 17 00:00:00 2001 From: Adam Gomaa Date: Thu, 12 Sep 2013 14:16:39 -0700 Subject: fix broken link to tox --- HACKING.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HACKING.txt b/HACKING.txt index 684a42ee6..4ebb59160 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -21,10 +21,10 @@ checkout. (alternately, create a writeable fork on GitHub and check that out). Since pyramid is a framework and not an application, it can be -convenient to work against a sample application, preferably in its -own virtualenv. A quick way to achieve this is to (ab-)use ``tox`` -(http://codespeak.net/~hpk/tox/) with a custom configuration file that's part of -the checkout:: +convenient to work against a sample application, preferably in its own +virtualenv. A quick way to achieve this is to (ab-)use ``tox`` +(http://tox.readthedocs.org/en/latest/) with a custom configuration +file that's part of the checkout:: tox -c hacking-tox.ini -- cgit v1.2.3