Skip to content

Instantly share code, notes, and snippets.

@goodwillcoding
Created October 29, 2013 05:03
Show Gist options
  • Save goodwillcoding/7209387 to your computer and use it in GitHub Desktop.
Save goodwillcoding/7209387 to your computer and use it in GitHub Desktop.
class NoRequestParamsPredicate(object):
def __init__(self, val, config):
self.val = bool(val)
def text(self):
return 'no_request_params = %s' % self.val
phash = text
def __call__(self, context, request):
params_do_not_exist = len(request.params) == 0
return params_do_not_exist is self.val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment