forked from orbit-oss/flask
Change docs to use f-strings
This commit is contained in:
parent
8f422d2b5e
commit
07caa44224
7 changed files with 13 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue