Skip to content

Instantly share code, notes, and snippets.

@jayd3e
Created March 21, 2015 17:56
Show Gist options
  • Save jayd3e/4ed724db34a54ad8b2f0 to your computer and use it in GitHub Desktop.
Save jayd3e/4ed724db34a54ad8b2f0 to your computer and use it in GitHub Desktop.
class RouteNamesViewPredicate(object):
def __init__(self, route_names, config):
self.route_names = route_names
def text(self):
return 'route_names = %s' % (self.route_names)
phash = text
def __call__(self, context, request):
if request.matched_route.name in self.route_names:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment