diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-12 12:58:43 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-12 12:58:43 -0400 |
| commit | 649ddf33537cd2a3ea2b1efc140cc74a16a81b10 (patch) | |
| tree | 4fa84fb4c998c131d3a6b7f17c411b3d611e82c2 /docs | |
| parent | dceff57884836c6bbf9099c427108e5fa9e46e58 (diff) | |
| download | pyramid-649ddf33537cd2a3ea2b1efc140cc74a16a81b10.tar.gz pyramid-649ddf33537cd2a3ea2b1efc140cc74a16a81b10.tar.bz2 pyramid-649ddf33537cd2a3ea2b1efc140cc74a16a81b10.zip | |
document replacement marker composition
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/urldispatch.rst | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index ad9cc6033..a6e46515f 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -138,11 +138,22 @@ replacement marker does not need to be preceded by a ``/`` character. A replacement marker is in the format ``{name}``, where this means "accept any characters up to the next slash character and use this as the ``name`` -:term:`matchdict` value." A matchdict is the dictionary representing the -dynamic parts extracted from a URL based on the routing pattern. It is -available as ``request.matchdict``. For example, the following pattern -defines one literal segment (``foo``) and two replacement markers (``baz``, -and ``bar``): +:term:`matchdict` value." + +A replacement marker in a pattern must begin with an uppercase or lowercase +ASCII letter or an underscore, and can be composed only of uppercase or +lowercase ASCII letters, underscores, and numbers. For example: ``a``, +``a_b``, ``_b``, and ``b9`` are all valid replacement marker names, but +``0a`` is not. + +.. note:: A replacement marker could not start with an underscore until + Pyramid 1.2. Previous versions required that the replacement marker start + with an uppercase or lowercase letter. + +A matchdict is the dictionary representing the dynamic parts extracted from a +URL based on the routing pattern. It is available as ``request.matchdict``. +For example, the following pattern defines one literal segment (``foo``) and +two replacement markers (``baz``, and ``bar``): .. code-block:: text |
