Pylons/pyramid — pull request #786 by latteier (2013-01-10 20:29:30+00:00)
Title: Make predicate mismatches not hide valid views

This is mostly an issue with views that use request_method predicates. See Issue #409

Here's a motivating example:

class IResource(Interface):
...

@view_config(context=IResource)
def get(context, request):
...

@view_config(context=IResource, request_method='POST')
def post(context, request):
...

@view_config(context=IResource, request_method='DELETE')
def delete(context, request):
...

@implementor(IResource)
class MyResource:
...

@view_config(context=MyResource, request_method='POST')
def override_post(context, request):
...

Currently the override_post view registration hides the get and delete views in the context of MyResource -- leading to a predicate mismatch error when trying to use GET or DELETE methods. With my patch the views are found and no predicate mismatch is raised.