Guest User

Untitled

a guest
Mar 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from django.core.cache import cache
  2.  
  3. def returnCache(function):
  4. def wrap(*args, **kwargs):
  5. if len(args) == 1:
  6. return_page = cache.get(function.__name__)
  7. if return_page:
  8. return_page
  9. else:
  10. return function(*args, **kwargs)
  11.  
  12. return wrap
Add Comment
Please, Sign In to add comment