自定义路由装饰器
这个问题在这里已经有了答案:
def adminRoute(*route_args, **route_kwargs):
def outer(action_function):
@app.route(*route_args, **route_kwargs)
@requiresAdmin
@functools.wraps(action_function)
def inner(*f_args, **f_kwargs):
return action_function(f_args, f_kwargs)
return inner
return outer
链接地址: http://www.djcxy.com/p/23817.html
下一篇: confused about python decorators. When/how are they called?