diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-06-30 18:05:18 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-06-30 18:05:18 +0000 |
| commit | 1a47ed8a6f2c552062b228c362edbea511e26dd6 (patch) | |
| tree | 7ebe3a5929b69e4fe135c877bfcd3e4f84c52995 | |
| parent | 23ab84757a4d216a7c5eea77e85aedfd3a9400ca (diff) | |
| download | pyramid-1a47ed8a6f2c552062b228c362edbea511e26dd6.tar.gz pyramid-1a47ed8a6f2c552062b228c362edbea511e26dd6.tar.bz2 pyramid-1a47ed8a6f2c552062b228c362edbea511e26dd6.zip | |
changelog gardening
| -rw-r--r-- | CHANGES.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 3c1b35a6a..1c631591a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -33,11 +33,21 @@ Features num_one_two_or_three = any_of('num, 'one', 'two', 'three') - add_route('/:num', custom_predicates=(num_one_two_or_three,)) + add_route('num', '/: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. + The ``path`` attribute is the route pattern. An example of using + the route in a set of route predicates:: + + def twenty_ten(info, request): + if info['route'].name in ('ymd', 'ym', 'y'): + return info['match']['year'] == '2010' + + add_route('y', '/:year', custom_predicates=(twenty_ten,)) + add_route('ym', '/:year/:month', custom_predicates=(twenty_ten,)) + add_route('ymd', '/:year/:month:/day', custom_predicates=(twenty_ten,)) + Documentation ------------- |
