On Thu, Jan 29, 2015 at 1:57 PM, Jonathan Vanasco <jonat...@findmeon.com> wrote:
> The __call__ method of a predicate factory must accept a resource (context)
> and a request, and must return True or False. It is the "meat" of the
> predicate.
>
> You can use the same predicate factory as both a view predicate and as a
> route predicate, but you'll need to call add_view_predicate and
> add_route_predicateseparately with the same factory.

Okay, I was worried as I was typing that something was amiss that I
hadn't found yet (hence the open an issue comment).

Basically, the docs are wrong about this and what I said is correct. I
hope that helps. My explanation should make sense as well. There is no
context when matching a route because traversal has not occurred yet,
and the default predicates available on routes and views are not the
same. They are documented in their respective apis (config.add_view vs
config.add_route).

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to