diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-11-30 19:46:45 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-11-30 19:46:45 -0700 |
| commit | 031d9f20baee7f57534a805809ac6a11319330ce (patch) | |
| tree | 9ab03b9fca24b5542441649eecf287f9e9f48e92 /docs/narr/handlers.rst | |
| parent | 3f0f1a7c9e0177352023bbe67b1eddf9185d759a (diff) | |
| parent | 5238ae329fb70e5e386db0b127d958c8523d7247 (diff) | |
| download | pyramid-031d9f20baee7f57534a805809ac6a11319330ce.tar.gz pyramid-031d9f20baee7f57534a805809ac6a11319330ce.tar.bz2 pyramid-031d9f20baee7f57534a805809ac6a11319330ce.zip | |
Merge https://github.com/Pylons/pyramid
Diffstat (limited to 'docs/narr/handlers.rst')
| -rw-r--r-- | docs/narr/handlers.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/narr/handlers.rst b/docs/narr/handlers.rst index d82f42bdb..0dce6afe4 100644 --- a/docs/narr/handlers.rst +++ b/docs/narr/handlers.rst @@ -37,6 +37,7 @@ will call that view callable. Here's an example view handler class: .. code-block:: python + :linenos: from pyramid.response import Response @@ -58,6 +59,7 @@ An accompanying call to the be performed in order to register it with the system: .. code-block:: python + :linenos: config.add_handler('hello', '/hello/{action}', handler=Hello) @@ -74,6 +76,7 @@ Alternatively, the action can be declared specifically for a URL to go to a specific ``action`` name: .. code-block:: python + :linenos: config.add_handler('hello_index', '/hello/index', handler=Hello, action='index') @@ -97,6 +100,7 @@ directly through to :meth:`pyramid.configuration.Configurator.add_route`. For example: .. code-block:: python + :linenos: config.add_handler('hello', '/hello/{action}', handler='mypackage.handlers:MyHandler') @@ -110,6 +114,7 @@ specify the same handler, to register specific route names for different handler/action combinations. For example: .. code-block:: python + :linenos: config.add_handler('hello_index', '/hello/index', handler=Hello, action='index') @@ -139,6 +144,7 @@ Every method in the handler class that has a name meeting the disabled by setting the ``__autoexpose__`` attribute to ``None``: .. code-block:: python + :linenos: from pyramid.view import action @@ -179,6 +185,7 @@ name that is different from the method name by passing in a ``name`` argument. Example: .. code-block:: python + :linenos: from pyramid.view import action @@ -205,6 +212,7 @@ URL's can result in different template renderings with the same data. Example: .. code-block:: python + :linenos: from pyramid.view import action |
