Change docs to use f-strings

This commit is contained in:
erfanio 2019-10-26 17:19:00 +11:00
parent 8f422d2b5e
commit 07caa44224
7 changed files with 13 additions and 13 deletions

View file

@ -82,11 +82,11 @@ Here the code::
from functools import wraps
from flask import request
def cached(timeout=5 * 60, key='view/%s'):
def cached(timeout=5 * 60, key='view/{}'):
def decorator(f):
@wraps(f)
def decorated_function(*args, **kwargs):
cache_key = key % request.path
cache_key = key.format(request.path)
rv = cache.get(cache_key)
if rv is not None:
return rv