Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from johnny.cache import get_backend
- from itertools import wraps
- def use_johnny(func):
- @wraps(func)
- def wrapper(*args, **kwargs):
- be = get_backend()
- be.patch()
- try:
- return func(*args, **kwargs)
- except:
- raise
- finally:
- be.unpatch()
- return wrapper
- @use_johnny
- def my_orm_using_thing():
- pass
Add Comment
Please, Sign In to add comment