summaryrefslogtreecommitdiff
path: root/docs/tutorials/bfgwiki2/basiclayout.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-06-18 06:35:21 +0000
committerChris McDonough <chrism@agendaless.com>2009-06-18 06:35:21 +0000
commitf8dbdee6167b3b4ab1ee4b2138a3e04e47a7c9df (patch)
tree2c03802fe9b3ab56d8e8bd067e437d3f29b92006 /docs/tutorials/bfgwiki2/basiclayout.rst
parent95a9cfc326f0fcb3bdfce1efe5c25748a7f8f077 (diff)
downloadpyramid-f8dbdee6167b3b4ab1ee4b2138a3e04e47a7c9df.tar.gz
pyramid-f8dbdee6167b3b4ab1ee4b2138a3e04e47a7c9df.tar.bz2
pyramid-f8dbdee6167b3b4ab1ee4b2138a3e04e47a7c9df.zip
- The matchdict related to the matching of a Routes route is available
on the request as the ``matchdict`` attribute: ``request.matchdict``. If no route matched, this attribute will be None.
Diffstat (limited to 'docs/tutorials/bfgwiki2/basiclayout.rst')
-rw-r--r--docs/tutorials/bfgwiki2/basiclayout.rst24
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/tutorials/bfgwiki2/basiclayout.rst b/docs/tutorials/bfgwiki2/basiclayout.rst
index 98e8bb183..303622c7e 100644
--- a/docs/tutorials/bfgwiki2/basiclayout.rst
+++ b/docs/tutorials/bfgwiki2/basiclayout.rst
@@ -32,16 +32,24 @@ XML namespace. Our sample ZCML file looks like the following:
SQLAlchemy connection after a request is finished.
#. *Lines 9-12*. Register a ``<route>`` that will be used when the
- URL is ``/``. Since this ``<view>`` has a blank ``name``
- attribute, it is the "default" view. ``.views.my_view`` refers to a
+ URL is ``/``. Since this ``<route>`` has an empty ``path``
+ attribute, it is the "default" route. The attribute named ``view``
+ with the value ``.views.my_view`` is the dotted name to a
*function* we write (generated by the ``bfg_routesalchemy``
template) that is given a ``context`` and a ``request`` and returns
- a response.
-
-#. *Lines 14-17*. Register a ``<route>`` with a path that starts with
- ``/static``, capturing the rest of the URL as ``subpath``. This is
- a view that will serve up static resources for us, in this case, at
- ``http://localhost:6543/static/`` and below.
+ a response. You will use mostly ``<route>`` statements in a
+ :term:`URL dispatch` based application to map URLs to code.
+
+#. *Lines 14-17*. Register a ``<view>`` with a path that starts with
+ ``/static``. This points at a bit of code (``.views.static_view``)
+ that will serve up static resources for us, in this case, at
+ ``http://localhost:6543/static/`` and below. ``<view>``
+ declarations also map code to URLs like ``route`` statements,
+ except they match URLs based on :term:`traversal`. With this view
+ declaration, we're saying that any URL that starts with ``/static``
+ should go to the static view; any remainder of its path (e.g. the
+ ``/foo`` in ``/static/foo``) will be used to compose a path to a
+ static file resource (CSS and such).
Content Models with ``models.py``
---------------------------------