From f8dbdee6167b3b4ab1ee4b2138a3e04e47a7c9df Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 18 Jun 2009 06:35:21 +0000 Subject: - 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. --- docs/tutorials/bfgwiki2/basiclayout.rst | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'docs/tutorials/bfgwiki2/basiclayout.rst') 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 ```` that will be used when the - URL is ``/``. Since this ```` has a blank ``name`` - attribute, it is the "default" view. ``.views.my_view`` refers to a + URL is ``/``. Since this ```` 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 ```` 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 ```` statements in a + :term:`URL dispatch` based application to map URLs to code. + +#. *Lines 14-17*. Register a ```` 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. ```` + 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`` --------------------------------- -- cgit v1.2.3