diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-06-30 17:24:23 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-06-30 17:24:23 +0000 |
| commit | 23ab84757a4d216a7c5eea77e85aedfd3a9400ca (patch) | |
| tree | 2c1718d303af84f09103603e0d8b2c3f8c1a446d /CHANGES.txt | |
| parent | 44bc118a61e2e9d93a65b8edd5be9118fb478741 (diff) | |
| download | pyramid-23ab84757a4d216a7c5eea77e85aedfd3a9400ca.tar.gz pyramid-23ab84757a4d216a7c5eea77e85aedfd3a9400ca.tar.bz2 pyramid-23ab84757a4d216a7c5eea77e85aedfd3a9400ca.zip | |
pass only match and route and document route minimally
Diffstat (limited to 'CHANGES.txt')
| -rw-r--r-- | CHANGES.txt | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 8eb1b57c7..3c1b35a6a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -17,11 +17,10 @@ Features always ``None``. As of this release, the first argument passed to a predicate is now - a dictionary conventionally named ``info`` consisting of ``match``, - ``route``, and ``mapper``. ``match`` is a dictionary: it represents - the arguments matched in the URL by the route. ``route`` is an - object representing the route that matched. ``mapper`` is the url - dispatch route mapper object. + a dictionary conventionally named ``info`` consisting of ``route``, + and ``match``. ``match`` is a dictionary: it represents the + arguments matched in the URL by the route. ``route`` is an object + representing the route which was matched. This is useful when predicates need access to the route match. For example:: @@ -30,11 +29,16 @@ Features def predicate(info, request): if info['match'][segment_name] in args: return True + return predicate num_one_two_or_three = any_of('num, 'one', 'two', 'three') add_route('/:num', custom_predicates=(num_one_two_or_three,)) + The ``route`` object is an object that has two useful attributes: + ``name`` and ``path``. The ``name`` attribute is the route name. + The ``path`` attribute is the route pattern. + Documentation ------------- |
