Closed kinorsi closed 10 years ago
My current solution:
def route(bp, *args, **kwargs):
def decorator(f):
@wraps(f)
def wrapper(*args, **kwargs):
return f(*args, **kwargs)
fun = wrapper
for arg in args:
fun = bp.route(arg, **kwargs)(fun)
return fun
return decorator
Currently, a view function only has one route. @route(bp, '/someurl', methods=['GET']). e.g. But how about if I need more then one url mapping for the same view function?