Created
March 21, 2015 17:56
-
-
Save jayd3e/4ed724db34a54ad8b2f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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