Guest User

Untitled

a guest
Mar 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 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. result = cache.get(function.__name__)
  7. if result:
  8. result
  9. else:
  10. return function(*args, **kwargs)
  11.  
  12. return wrap
Add Comment
Please, Sign In to add comment