From 23bfce0ea0fae605f67547f7b12e91fbe329d506 Mon Sep 17 00:00:00 2001 From: Blaise Laflamme Date: Sun, 28 Nov 2010 02:21:38 -0500 Subject: Narrative doc cleanup --- docs/narr/urldispatch.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/narr/urldispatch.rst') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index df7d592f9..0fc7d22af 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -350,7 +350,9 @@ also capture the remainder of the URL, for example: foo/{baz}/{bar}{fizzle:.*} The above pattern will match these URLs, generating the following -matchdicts:: +matchdicts: + +.. code-block:: text foo/1/2/ -> {'baz':'1', 'bar':'2', 'fizzle':()} foo/abc/def/a/b/c -> {'baz':'abc', 'bar':'def', 'fizzle': 'a/b/c')} -- cgit v1.2.3 From 16cd50c1a5beef98c3297d105c1ccffccb8872c5 Mon Sep 17 00:00:00 2001 From: Blaise Laflamme Date: Sun, 28 Nov 2010 12:28:30 -0500 Subject: Normalized narrative doc, code with linenos while text+bash don't --- docs/narr/urldispatch.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/narr/urldispatch.rst') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 0fc7d22af..b025ce8d6 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -1143,6 +1143,7 @@ custom notfound view as the first argument to its constructor. For instance: .. code-block:: python + :linenos: from pyramid.exceptions import NotFound from pyramid.view import AppendSlashNotFoundViewFactory -- cgit v1.2.3 From 6942961545fd909bbb6d16a1ab7992351b1586e6 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 1 Dec 2010 11:09:50 -0500 Subject: fix bad info in urldispatch chapter: matchdict and matched_route will be None --- docs/narr/urldispatch.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/narr/urldispatch.rst') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index b025ce8d6..e439c71cd 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -838,8 +838,8 @@ strings. The values will be Unicode objects. .. note:: - If no route URL pattern matches, no ``matchdict`` is attached to - the request. + If no route URL pattern matches, the ``matchdict`` object attached to the + request will be ``None``. .. index:: single: matched_route @@ -857,6 +857,11 @@ an attribute of the :term:`request` object. Thus, request. The most useful attribute of the route object is ``name``, which is the name of the route that matched. +.. note:: + + If no route URL pattern matches, the ``matched_route`` object attached to + the request will be ``None``. + Routing Examples ---------------- -- cgit v1.2.3