Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. sso_decorator = decorator_from_middleware_with_args(SSOMiddleware)
  2.  
  3. @sso_decorator(True):
  4. def index():
  5. ...
  6.  
  7. @sso_decorator(False):
  8. def view():
  9. ...
  10.  
  11. class SSOMiddleware:
  12.  
  13. def __init__(self, some_arg=False):
  14. self.some_arg = some_arg
  15.  
  16. def process_request(self, request):
  17. print self.some_arg
  18.  
  19. Some argument: False
  20. Some argument: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement