diff options
| author | Chris McDonough <chrism@plope.com> | 2010-10-29 13:23:31 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-10-29 13:23:31 -0400 |
| commit | 197f0cb39d0a865476405dda21ad0d3e20ee0789 (patch) | |
| tree | 061f4595339022831dcd2c31275d0964eed77647 /docs/designdefense.rst | |
| parent | 66ecc57eb00063edfa01d66f8d6f4495d21d79b5 (diff) | |
| download | pyramid-197f0cb39d0a865476405dda21ad0d3e20ee0789.tar.gz pyramid-197f0cb39d0a865476405dda21ad0d3e20ee0789.tar.bz2 pyramid-197f0cb39d0a865476405dda21ad0d3e20ee0789.zip | |
bfg_view -> view_config
Diffstat (limited to 'docs/designdefense.rst')
| -rw-r--r-- | docs/designdefense.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 0e4784c66..8242d7d81 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -374,14 +374,14 @@ which don't use interfaces. Instead, each predicate uses a domain-specific string as a match value. For example, to write a view configuration which matches only requests -with the ``POST`` HTTP request method, you might write a ``@bfg_view`` +with the ``POST`` HTTP request method, you might write a ``@view_config`` decorator which mentioned the ``request_method`` predicate: .. code-block:: python :linenos: - from pyramid.view import bfg_view - @bfg_view(name='post_view', request_method='POST', renderer='json') + from pyramid.view import view_config + @view_config(name='post_view', request_method='POST', renderer='json') def post_view(request): return 'POSTed' @@ -392,8 +392,8 @@ response: .. code-block:: python :linenos: - from pyramid.view import bfg_view - @bfg_view(name='post_view', request_method='POST', accept='application/json', + from pyramid.view import view_config + @view_config(name='post_view', request_method='POST', accept='application/json', renderer='json') def post_view(request): return 'POSTed' @@ -417,13 +417,13 @@ acommodate this by allowing people to define "custom" view predicates: .. code-block:: python :linenos: - from pyramid.view import bfg_view + from pyramid.view import view_config from webob import Response def subpath(context, request): return request.subpath and request.subpath[0] == 'abc' - @bfg_view(custom_predicates=(subpath,)) + @view_config(custom_predicates=(subpath,)) def aview(request): return Response('OK') |
