From 23ab84757a4d216a7c5eea77e85aedfd3a9400ca Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 30 Jun 2010 17:24:23 +0000 Subject: pass only match and route and document route minimally --- CHANGES.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'CHANGES.txt') 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 ------------- -- cgit v1.2.3