From 62eaa2d1d4b195eac913cfa86992a3aaf1a315a2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 30 Jun 2010 19:56:42 +0000 Subject: more documentation fallout from allowing predicates access to route matching information --- docs/zcml/route.rst | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'docs/zcml') diff --git a/docs/zcml/route.rst b/docs/zcml/route.rst index 8bee3c14f..cf765e04f 100644 --- a/docs/zcml/route.rst +++ b/docs/zcml/route.rst @@ -103,20 +103,28 @@ Attributes .. note:: This feature is new as of :mod:`repoze.bfg` 1.1. ``custom_predicates`` + This value should be a sequence of references to custom predicate callables. Use custom predicates when no set of predefined predicates does what you need. Custom predicates can be combined with predefined predicates as necessary. Each custom predicate - callable should accept two arguments: ``context`` and ``request`` + callable should accept two arguments: ``info`` and ``request`` and should return either ``True`` or ``False`` after doing arbitrary - evaluation of the context and/or the request. If all callables - return ``True``, the associated route will be considered viable for - a given request. If any custom predicate returns ``False``, route - matching continues. Note that the value ``context`` will always be - ``None`` when passed to a custom route predicate. + evaluation of the info and/or the request. If all custom and + non-custom predicate callables return ``True`` the associated route + will be considered viable for a given request. If any predicate + callable returns ``False``, route matching continues. Note that the + value ``info`` passed to a custom route predicate is a dictionary + containing matching information; see :ref:`custom_route_predicates` + for more information about ``info``. .. note:: This feature is new as of :mod:`repoze.bfg` 1.2. + .. note:: The ``info`` argument passed to a custom predicate in + versions prior to :mod:`repoze.bfg` 1.3 was always + ``None``. + + ``view_context`` The :term:`dotted Python name` to a class or an interface that the :term:`context` of the view should match for the view named by the -- cgit v1.2.3